upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/d3d12_vulkan.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/d3d12_vulkan.md')
-rw-r--r--docs/d3d12_vulkan.md18
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md
index cd325bded..bd7acdb11 100644
--- a/docs/d3d12_vulkan.md
+++ b/docs/d3d12_vulkan.md
@@ -2202,8 +2202,12 @@ The game can use D3D12 descriptors in three ways, and the layer must handle all
2202 any reader names title memory) or in a buffer of ours as the title wrote it (`reachable_as_written`), other words 2202 any reader names title memory) or in a buffer of ours as the title wrote it (`reachable_as_written`), other words
2203 null. The filter runs inside the mirror's fills, under its lock, so it takes no other lock of ours: a V# the mirror 2203 null. The filter runs inside the mirror's fills, under its lock, so it takes no other lock of ours: a V# the mirror
2204 does not hold (an interim, until every title allocation is in the mirror) reads null until the heap's refresh 2204 does not hold (an interim, until every title allocation is in the mirror) reads null until the heap's refresh
2205 resolves it as a copied slot was, and a T# is bound there too (its bindless index in the entry comes later), each 2205 resolves it as a copied slot was, and a T# is bound there too, its home dword 6 then taking the bindless index word
2206 result written into the home unless the title rewrote the slot meanwhile (`finish_in_place`). Lock order: 2206 (`tsharp_index_word`, docs/design.md "Bindless index in the T#"; 0, the fallback, from the filter until then and
2207 while the T# waits; the title's dword 6 stays in its bytes), each result written into the home unless the title
2208 rewrote the slot meanwhile (`finish_in_place`). The upload's sums per 256-byte piece are of the title's bytes for
2209 such a page, so the mirror calls the filter only when a piece of the title's page changed, and `write_back` skips
2210 it. Lock order:
2207 `console_heap_mutex`, then the mirror's, then the change list's. The changes are applied to the homes at the 2211 `console_heap_mutex`, then the mirror's, then the change list's. The changes are applied to the homes at the
2208 mirror's refresh, before the pages written since are filled. No GPU write is ever copied back from these pages 2212 mirror's refresh, before the pages written since are filled. No GPU write is ever copied back from these pages
2209 (`TitleMirror::filtered_at`). A heap the mirror does not hold (a device without the mirror, memory outside its 2213 (`TitleMirror::filtered_at`). A heap the mirror does not hold (a device without the mirror, memory outside its
@@ -2235,7 +2239,9 @@ The layer's descriptor model:
2235 which is the assumption to verify. If it uses an opaque format, the layer must translate at bind time. 2239 which is the assumption to verify. If it uses an opaque format, the layer must translate at bind time.
2236- At execution, for each bound table (or the whole bound heap when direct indexing is enabled), the layer walks 2240- At execution, for each bound table (or the whole bound heap when direct indexing is enabled), the layer walks
2237 the declared descriptor range with the heap's stride, parses each T#/S#, and ensures a bindless entry exists: 2241 the declared descriptor range with the heap's stride, parses each T#/S#, and ensures a bindless entry exists:
2238 - image T# → `VkImageView` (format, view type, mip range, array layers) → bindless image index; 2242 - image T# → `VkImageView` (format, view type, mip range, array layers) → bindless image index, which the layer
2243 writes into dword 6 of the T# where shaders read it (the console heap copy's slot, or the layer's own heap), with
2244 the arrays it is bound in (`docs/design.md`, "Bindless index in the T#"); the hash table keeps the key as written;
2239 - sampler S# → `VkSampler` (filter, address modes, LOD, compare, anisotropy) → bindless sampler index; 2245 - sampler S# → `VkSampler` (filter, address modes, LOD, compare, anisotropy) → bindless sampler index;
2240 - buffer V# / CBV → no Vulkan view; the descriptor already contains a console VA the shader dereferences. 2246 - buffer V# / CBV → no Vulkan view; the descriptor already contains a console VA the shader dereferences.
2241- **Buffer UAVs.** `CreateUnorderedAccessView` on a buffer writes a V# in the first 16 bytes of the slot (the rest of 2247- **Buffer UAVs.** `CreateUnorderedAccessView` on a buffer writes a V# in the first 16 bytes of the slot (the rest of
@@ -4801,6 +4807,12 @@ store, load, mesh, geometry and BVH tests; this layer is the other half.
4801 4807
4802### 5.1 Descriptor hash table details 4808### 5.1 Descriptor hash table details
4803 4809
4810Since the T# index word (`docs/design.md`, "Bindless index in the T#") the table serves only what the word does not
4811reach: every S#, and the T#s a translated module cannot trace to a heap slot (1,062 of the 439,415 T# operands of
4812the 1.0.2.1 corpus, in 108 modules). A T# loaded from a heap the layer writes carries its index and kind in dword 6
4813and is never looked up. Every T# key is still inserted, as the title wrote it: a T# outside the heaps is found by
4814those words.
4815
4804The exact layout the shader reads (from `tools/rdna2spirv.py`, `desc_lookup`): 4816The exact layout the shader reads (from `tools/rdna2spirv.py`, `desc_lookup`):
4805 4817
4806``` 4818```