aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 03:39:29 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 03:39:29 -0400
commitea6c1193fbfa95e586bb6d129dc684163a12cb3e (patch)
treee4d23143900184630deeabe27eab1321dac4a428 /src/video_core/renderer_vulkan
parent0bb5055b6541c74f47603a8dff0569a509cbaf18 (diff)
Revert "Import experimental NS2 support and accumulated GPU fixes"
This reverts commit 535b676970. The Switch 2 support comes from the nx2 work instead, merged next.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/present/layer.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp65
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp5
5 files changed, 3 insertions, 74 deletions
diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp
index 8a11c356ff..9f4aaf390f 100644
--- a/src/video_core/renderer_vulkan/present/layer.cpp
+++ b/src/video_core/renderer_vulkan/present/layer.cpp
@@ -349,7 +349,7 @@ void Layer::UpdateRawImage(const Tegra::FramebufferConfig& framebuffer, size_t i
if (host_ptr) {
Tegra::Texture::UnswizzleTexture(
mapped_span.subspan(image_offset, linear_size), std::span(host_ptr, tiled_size),
- bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0, 1, framebuffer.native_tiling);
+ bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0);
buffer.Flush(); // Ensure host writes are visible before the GPU copy.
}
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
index bd092271e4..ab58560170 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
@@ -633,7 +633,7 @@ struct alignas(16) BlockLinearUnswizzle3DPushConstants {
u32 block_depth; // Offset 48
u32 block_depth_mask; // Offset 52
- u32 native_tiling; // Offset 56
+ s32 _pad; // Offset 56
s32 destination[3]; // Offset 60
s32 _pad_end; // Offset 72
@@ -753,7 +753,6 @@ void BlockLinearUnswizzle3DPass::UnswizzleChunk(
pc.block_height_mask = params.block_height_mask;
pc.block_depth = params.block_depth;
pc.block_depth_mask = params.block_depth_mask;
- pc.native_tiling = params.native_tiling;
pc.blocks_dim[0] = blocks_x;
pc.blocks_dim[1] = blocks_y;
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 5e0975a231..d4ffcd8317 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -786,7 +786,7 @@ GraphicsPipeline* PipelineCache::BuiltPipeline(GraphicsPipeline* pipeline) const
if (pipeline->IsBuilt()) {
return pipeline;
}
- if (maxwell3d->GetNativeMacroEngine().native_turing || !use_asynchronous_shaders) {
+ if (!use_asynchronous_shaders) {
return pipeline;
}
// If something is using depth, we can assume that games are not rendering anything which
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 740c988550..264ffb28b5 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -7,8 +7,6 @@
#include <algorithm>
#include <array>
#include <memory>
-#include <cstdlib>
-#include <fstream>
#include <mutex>
#include <fmt/format.h>
@@ -16,14 +14,12 @@
#include "video_core/renderer_vulkan/renderer_vulkan.h"
#include "common/assert.h"
-#include "shader_recompiler/exception.h"
#include "common/logging.h"
#include "common/scope_exit.h"
#include "common/settings.h"
#include "video_core/buffer_cache/buffer_cache.h"
#include "video_core/gpu_logging/gpu_logging.h"
#include "video_core/control/channel_state.h"
-#include "video_core/native_query_trace.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/kepler_compute.h"
#include "video_core/engines/maxwell_3d.h"
@@ -242,14 +238,6 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) {
SCOPE_EXIT {
gpu.TickWork();
};
- bool submitted = false;
- SCOPE_EXIT {
- auto& native = maxwell3d->GetNativeMacroEngine();
- if (native.native_turing && !submitted) {
- native.native_execution_failed = true;
- LOG_ERROR(HW_GPU, "Native graphics draw failed; refusing submission completion");
- }
- };
FlushWork();
gpu_memory->FlushCaching();
@@ -269,45 +257,6 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) {
HandleTransformFeedback();
query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, maxwell3d->regs.zpass_pixel_count_enable);
draw_func();
- submitted = true;
- static u32 native_capture_count{};
- if (maxwell3d->GetNativeMacroEngine().native_turing &&
- std::getenv("EDEN_NATIVE_DRAW_CAPTURE") && native_capture_count < 16) {
- const u32 capture = native_capture_count++;
- const auto prefix = fmt::format("native-draw-{}", capture);
- const auto dump = [&](const std::string& name, GPUVAddr address, size_t size) {
- if (!size || !gpu_memory->IsFullyMappedRange(address, size)) return;
- std::vector<u8> bytes(size);
- gpu_memory->ReadBlockUnsafe(address, bytes.data(), bytes.size());
- std::ofstream file(prefix + name + ".bin", std::ios::binary);
- file.write(reinterpret_cast<const char*>(bytes.data()), bytes.size());
- LOG_INFO(HW_GPU, "Native draw capture {}{}: address={:#x}, bytes={}, nonzero={}",
- capture, name, address, size,
- std::count_if(bytes.begin(), bytes.end(), [](u8 byte) { return byte != 0; }));
- };
- const auto& regs = maxwell3d->regs;
- const auto& rt = regs.rt[0];
- const size_t size = static_cast<size_t>(rt.array_pitch) * 4;
- if (size && size <= 16 * 1024 * 1024) {
- if (const auto address = gpu_memory->GpuToCpuAddress(rt.Address(), size)) {
- LOG_INFO(HW_GPU, "Native draw {} render target physical address={:#x}", capture, *address);
- texture_cache.DownloadMemory(*address, size);
- dump("-rt0", rt.Address(), size);
- }
- }
- std::ofstream registers(prefix + "-registers.bin", std::ios::binary);
- registers.write(reinterpret_cast<const char*>(&regs), sizeof(regs));
- for (size_t stream = 0; stream < 4; ++stream) {
- if (regs.vertex_streams[stream].IsEnabled())
- dump(fmt::format("-vertex-{}", stream), regs.vertex_streams[stream].Address(), 128);
- }
- for (size_t stage : {0U, 4U}) {
- for (size_t bank : {2U, 3U}) {
- const auto& cb = maxwell3d->state.shader_stages[stage].const_buffers[bank];
- if (cb.enabled) dump(fmt::format("-cbuf-{}-{}", stage, bank), cb.address, std::min<size_t>(cb.size, 128));
- }
- }
- }
}
void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) {
@@ -639,13 +588,11 @@ void RasterizerVulkan::DispatchCompute() {
ComputePipeline* const pipeline{pipeline_cache.CurrentComputePipeline()};
if (!pipeline) {
- if (kepler_compute->IsNativeMode()) throw Shader::RuntimeError("Native compute pipeline unavailable");
return;
}
std::scoped_lock lock{texture_cache.mutex, buffer_cache.mutex};
if (!pipeline->Configure(*kepler_compute, *gpu_memory, scheduler, buffer_cache,
texture_cache)) {
- if (kepler_compute->IsNativeMode()) throw Shader::RuntimeError("Native compute resources unavailable");
return;
}
@@ -995,12 +942,6 @@ Tegra::Engines::AccelerateDMAInterface& RasterizerVulkan::AccessAccelerateDMA()
void RasterizerVulkan::AccelerateInlineToMemory(GPUVAddr address, size_t copy_size,
std::span<const u8> memory) {
auto cpu_addr = gpu_memory->GpuToCpuAddress(address);
- if (gpu_memory->UsesNativeTiling()) {
- u32 first_word{};
- if (memory.size() >= sizeof(first_word)) std::memcpy(&first_word, memory.data(), sizeof(first_word));
- VideoCommon::TraceNativeQuery(11, gpu_memory->GetID(), address, cpu_addr.value_or(0),
- 0, first_word, static_cast<u32>(copy_size));
- }
if (!cpu_addr) [[unlikely]] {
gpu_memory->WriteBlock(address, memory.data(), copy_size);
return;
@@ -1028,12 +969,6 @@ std::optional<FramebufferTextureInfo> RasterizerVulkan::AccelerateDisplay(
std::scoped_lock lock{texture_cache.mutex};
const auto [image_view, scaled] =
texture_cache.TryFindFramebufferImageView(config, framebuffer_addr);
- static u32 display_trace_count{};
- if ((std::getenv("EDEN_NATIVE_FRAME_CAPTURE") || std::getenv("EDEN_NATIVE_DRAW_DIAGNOSTICS")) && display_trace_count++ < 64) {
- LOG_INFO(HW_GPU, "Native display source: address={:#x}, offset={:#x}, dimensions={}x{}, stride={}, accelerated={}, mask={:#x}",
- framebuffer_addr, config.offset, config.width, config.height, pixel_stride,
- image_view != nullptr, config.layer_stack_mask);
- }
if (!image_view) {
return {};
}
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 29afaac01b..583cb6edaf 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -2085,11 +2085,6 @@ void Image::DownloadMemory(VkBuffer buffer, size_t offset,
void Image::DownloadMemory(std::span<VkBuffer> buffers_span, std::span<size_t> offsets_span,
std::span<const VideoCommon::BufferImageCopy> copies) {
- if (!original_image) {
- LOG_CRITICAL(Render_Vulkan, "Missing image at download: gpu={:#x}, cpu={:#x}, type={}, format={}, flags={:#x}, size={}, dimensions={}x{}",
- gpu_addr, cpu_addr, static_cast<u32>(info.type), static_cast<u32>(info.format),
- static_cast<u32>(flags), unswizzled_size_bytes, info.size.width, info.size.height);
- }
const bool is_rescaled = True(flags & ImageFlagBits::Rescaled);
if (is_rescaled) {
ScaleDown();