upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authorEtr0p <216035314+Etr0p@users.noreply.github.com>2026-11-23 20:38:42 +0100
committerEtr0p <216035314+Etr0p@users.noreply.github.com>2026-11-23 20:38:42 +0100
commitab1fbff95dbd8becb9866f2a26fafac80ed1f6a4 (patch)
tree27b29aa0a6c38dd90f312779999ae838fd298cb5 /runtime/shims/d3d12_com.cpp
parent14dc9af525c5e54f9edbde43ccb2bbe499007852 (diff)
d3d12: shaders reach a title-placed buffer through the root views and buffer V#s the layer writes
Xbox device slot 133 places a buffer at the title's own VA, about 1.5 TiB on Windows, while a translated shader computes heap_base + console VA with heap_base the arena's device address. A root view or V# naming that VA missed the buffer. The layer now translates an address inside a title-placed buffer where it writes it (root CBV/SRV/UAV, CBV and buffer SRV/UAV V#s): to the arena offset of the slot-133 shadow, which now lives in the GPU address arena when it fits, or to an import's device address minus heap_base. New tests: title_va_alias_test, d3d12_title_va_test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index e33769c58..2d7d6de71 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -6,6 +6,7 @@
6#include "d3d12_trace.h" 6#include "d3d12_trace.h"
7#include "d3d12_xs_device.h" 7#include "d3d12_xs_device.h"
8#include "../src/gfx10_descriptors.h" 8#include "../src/gfx10_descriptors.h"
9#include "../src/title_va_alias.h"
9 10
10#include <algorithm> 11#include <algorithm>
11#include <array> 12#include <array>
@@ -1167,6 +1168,10 @@ private:
1167 return; 1168 return;
1168 const RootArgumentLayout::Parameter* p = parameter(state, index, type); 1169 const RootArgumentLayout::Parameter* p = parameter(state, index, type);
1169 if (!p) return; 1170 if (!p) return;
1171 // A root view inside a buffer the title placed at its own VA (device slot 133) gets the console VA of the
1172 // buffer's GPU copy, so the shader's heap_base + VA reaches it (src/title_va_alias.h). Descriptor tables are
1173 // the layer's own heaps: never translated.
1174 if (type == rt::rootsig::ParamType::Descriptor) va = leonida::title_va_aliases().shader_va(va);
1170 const std::uint32_t first = first_dword(state, *p); 1175 const std::uint32_t first = first_dword(state, *p);
1171 write(state, first, std::uint32_t(va)); 1176 write(state, first, std::uint32_t(va));
1172 // In the compute layout a descriptor table is one dword, the 32-bit VA of its first descriptor (the heaps 1177 // In the compute layout a descriptor table is one dword, the 32-bit VA of its first descriptor (the heaps