aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan/vk_rasterizer.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 01:55:10 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 01:55:10 -0400
commit585e457172693730fe82f34a2ce513ac7cdc948d (patch)
treee4d5716861d2e133fae7251a33cb11452d6d1862 /src/video_core/renderer_vulkan/vk_rasterizer.cpp
parent869c6e4b33a6432166597f6f48812d44b3f5de02 (diff)
nx2: stand in for title 4's tensor-core upscaler and its blit constants
- When a compute program is rejected for tensor-core math, blit its input image (handle at cbuf0+0x90) to its output (cbuf0+0xa0) with bilinear filtering. Title 4 renders at 2560x1440 and upscales to 3840x2160 with a DLSS-style network; this keeps the 4K output fed. EDEN_NX2_TENSOR=stub keeps the program with HMMA as D = C (for experiments). - BlitConstantsPass: vertex shaders reading bank 24 (lowered to 17) get the console-provided blit block synthesized from the render area (texel size, size, UV scale 1, rectangle 0..W-1,H-1). - Debug: EDEN_NX2_CB24_TRACE, upscaler resource description and render target sampling at the fallback. The scene behind the intro dialogue is still black: the tonemap output that feeds the upscaler has no colour although earlier targets do.
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 044c783a99..47a55c9580 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -399,6 +399,35 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) {
TraceWindowTarget(*maxwell3d, *gpu_memory, is_indexed ? "draw-indexed" : "draw",
is_indexed ? maxwell3d->draw_manager.draw_state.index_buffer.count
: maxwell3d->draw_manager.draw_state.vertex_buffer.count);
+ // EDEN_NX2_CB24_TRACE: for draws whose vertex shader reads bank 24, show the inline
+ // constant buffer upload target (CB_ADDRESS) and its first words.
+ if (static const bool trace = std::getenv("EDEN_NX2_CB24_TRACE") != nullptr; trace) {
+ const auto& regs = maxwell3d->regs;
+ const u64 vs = (u64{regs.pipelines[1].reserved[0] & 0xff} << 32) | regs.pipelines[1].reserved[1];
+ static u32 logged{};
+ if ((vs == 0x11471c9a00 || vs == 0x11471ca600 || vs == 0x11471cd300) && logged++ < 3) {
+ std::array<u32, 24> words{};
+ gpu_memory->ReadBlockUnsafe(regs.const_buffer.Address(), words.data(), sizeof(words));
+ LOG_INFO(HW_GPU, "bank24 draw vs={:#x}: CB_ADDRESS {:#x} size {:#x} offset {:#x}: {:08x}", vs,
+ regs.const_buffer.Address(), regs.const_buffer.size, regs.const_buffer.offset,
+ fmt::join(words, " "));
+ // Search every bound vertex-stage buffer for render-target-size values.
+ const auto& stage = maxwell3d->state.shader_stages[0];
+ for (u32 slot = 0; slot < Tegra::Engines::Maxwell3D::Regs::MaxConstBuffers; ++slot) {
+ const auto& buffer = stage.const_buffers[slot];
+ if (!buffer.enabled || buffer.size == 0) continue;
+ std::vector<u32> data(std::min<u32>(buffer.size, 0x10000) / 4);
+ gpu_memory->ReadBlockUnsafe(buffer.address, data.data(), data.size() * 4);
+ for (size_t i = 0; i < data.size(); ++i) {
+ const u32 w = data[i];
+ if (w == 0x45200000 || w == 0x44b40000 || w == 0x39cccccd || w == 0x3a360b61 ||
+ w == 0x44a00000 || w == 0x44340000 || w == 2559 || w == 1439) {
+ LOG_INFO(HW_GPU, " slot {} +{:#x} = {:#x}", slot, i * 4, w);
+ }
+ }
+ }
+ }
+ }
// EDEN_NX2_RT_TRACE: log the first draw to every distinct colour target (debug aid).
if (static const bool trace = std::getenv("EDEN_NX2_RT_TRACE") != nullptr; trace) {
static std::set<std::tuple<GPUVAddr, u32, u32, u64, u64>> seen;