- Tone map: identity up to 0.8 of SDR white, extended Reinhard shoulder above it, continuous in value and slope, content
peak maps to 1.0 (SDR-range content is no longer darkened).
- The Windows SDR white level is read by a background thread (about once a second, only while HDR10 is in use);
PresentX reads an atomic. A failed query keeps the last good value; QueryDisplayConfig retries on
ERROR_INSUFFICIENT_BUFFER.
- LEONIDA_SDR_EOTF is case-insensitive, unknown or too long values are logged; setters are atomics; <cwchar> for wcscmp.
- Tests: eight-step HDR10 ramp with hand-calculated bytes, curve properties (monotonic, identity below the knee, peak 1,
slope continuity), HDR10 plane 1 over SDR plane 0 on HDR10 and SDR outputs, hand-calculated 50% overlay bytes, query cost.
- Docs 4.5: shoulder description, query cost, sources marked (KWin claim unverified, vkd3d-proton file partly read, the
measured 80 nits only covers the SDR fallback path).
- present_compose.inc rebuilt with glslc 2026.4 (reproducible, spirv-val clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep PROC-129's merged rows 19 and 20 and drop the copies reintroduced by
main. The open-questions table remains ordered and duplicate-free.
Co-Authored-By: Claude <noreply@anthropic.com>
@pwu2775-dev found on #2533 that the tests' WKPDID_D3DDebugObjectNameW was
mistyped ({4cca5fd8-921f-42c8-8599-d2866a3e5f7e}, the layer's old constant)
instead of d3dcommon.h's {4cca5fd8-921f-42c8-8566-70caf2a9b741}. Measured with
the right key, the host runtime does what D3D12 documents: SetName is
SetPrivateData with that key and the name with its terminator, GetPrivateData
reads it back (an empty name is a 2-byte entry), and the narrow key is not
touched. SetName(nullptr) faults in the host and leaves the name as it was.
So the name goes back into the private data, now under the right GUID, and the
separate name_ / debug_name() are gone. SetName(nullptr) answers E_INVALIDARG
and changes nothing. d3d12_private_data_test: 667 steps compared, 0 mismatches
(RTX 3060, driver 610.88); d3d12_debug_markers_test checks the name again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--disasm now scans tools/fspx_unpack.py output for the user SGPRs a program reads, the one it zero-extends into an
s_load base and the pairs it copies whole. Over the 29 containers that puts the two tables at s4 and s5 one dword
each and the root CBVs at whole pairs from s6, which is the one-dword-per-table model, so docs/d3d12_vulkan.md states
the mapping instead of calling it merely consistent.
Recounted with main 49475796 on the 1.0.2.1 package (counts only): 52/52 unpack,
42 clean and 10 with invalid words in the disassembly, 51 translate and pass
spirv-val. The four rules embedded_shaders.md listed are three since 427c1376
(#1968); Box16Rehydration stops at buffer_store_short (#1864). d3d12_vulkan.md
and the docs index quoted 41/42 and four rules in seven places.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge rounds left rows 16, 19 and 20 of section 8.2 twice and row 10 after
13. Row 16 keeps the shader answer (feature_scan over the corpus) and the
runtime-side status; row 19's copies were identical; row 20 keeps both
counts (52 containers with FSSM and Xbox DXIL, the 53 compute PSO
creations bvh_builder_test sees), both questions (a reference match, the 31
raw-address shaders) and both methods. Row 10 moves back between 9 and 11.
Rows 16, 19 and 20 appeared twice with partially different text; keep every
fact in one row each. Row 10 sat after row 13; put it back in numeric order.
No game data, no code or test behaviour change.
Co-Authored-By: Claude <noreply@anthropic.com>
VulkanContext::buffer_at walked every registered resource, images included,
for each vertex-buffer slot, index buffer and WriteBufferImmediate of every
draw. It now asks a BufferVaIndex of the addressable buffers (no image, a
VkBuffer, a VA and bytes: what the scan accepted), kept in step with
resources_ by add_resource, add_sparse_buffer and remove_resource; a
re-registered ID drops its old range first.
Where placed buffers alias, the scan returned whichever matched first in
unordered_map order; the index returns the range that starts closest below
the VA. docs/d3d12_vulkan.md drops the "Lookups" known gap.
- Compose pass decodes every texel to linear (premultiplied) before filtering, converts the plane to the output's linear
working space (Rec.2020 nits for HDR10, Rec.709 relative to SDR white for SDR), blends there and encodes once.
- SDR EOTF is piecewise sRGB by default (community-sourced Windows behaviour), gamma 2.2 by
XboxPresentation::set_sdr_eotf or LEONIDA_SDR_EOTF=gamma22.
- SDR white: set_sdr_white_nits override, else DISPLAYCONFIG_SDR_WHITE_LEVEL of the window's output while HDR10 is
active, else 203 nits (BT.2408).
- HDR10 on an SDR output: extended Reinhard on luminance (white point at the content peak, default 1000 nits) instead of a
hard clip.
- HDR metadata stays unsent; docs section 4.5 documents the decisions and cites the sources.
- CPU reference model and xbox_present_test updated (linear model, EOTF option, 50% overlay, tone map, white level query).
- present_compose.inc rebuilt with glslc 2026.4 (byte-reproducible, spirv-val clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8x8x64 R8, 16x16x16 RGBA8, 16x16x17 RGBA8 and 8x8x8 RGBA32F were in the
table twice with the same expectations. The deep-volume set is 32 new
layouts, 79 distinct in all; the header comment and docs/d3d12_vulkan.md
section 4.2 now say so.
AI-assisted (Claude Code).
docs/d3d12_vulkan.md left root-parameter visibility open: one block in
root order (the layer's model) or the console omitting a stage's invisible
parameters, which would put different parameters at the same SGPR in a VS
and a PS. The game's shaders carry no RTS0 and the executable that pairs
them into pipelines is not in the package, so --pairs pairs a VS with a PS
by technique name (names alike apart from the VS_/PS_ token) and compares
the user SGPRs both read, with all VS x PS combinations as a control.
On the 1.0.2.1 corpus: 166 techniques have both stages, 358 combinations.
All 379 shared reads have the same kind (pointer or constant), against
25.5% different over all 26,196,976 combinations; and all 111 shared
reads above an SGPR only one stage reads still agree, where omission
would have moved them. The doc records the counts and the limits: names
approximate the pipelines, and a visible parameter a stage doesn't read
looks like a hidden one.
The tests build both models from one root signature and check that they
give different counts. Names are used for pairing only, never printed.
AI-assisted.
The layer clamped every HighestVersion above 1.1 to 1.1 and returned S_OK.
The host only does that for versions it defines: on an RTX 4070 Laptop
(621.24) and WARP, anything above 1.2 is E_INVALIDARG with the value left
unchanged. Keep the clamp for 1.2 and refuse the rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ID3D12Fence::Signal from the CPU called vkSignalSemaphore at once, also while a queue Signal of a lower value
was still pending on the GPU. Vulkan requires a host signal to stay below every pending signal
(VUID-VkSemaphoreSignalInfo-value-03259), and D3D12 allows the order. The fence now records the highest value a
queue will signal, under the same lock as the claim, and a CPU signal above a value the GPU has not reached yet
(or made while an earlier one is held) is handed to the fence dispatcher, which applies it once the GPU passes
that value, in the order the signals were made. The callback holds no pointer to the fence; when the fence is
released (cancel) or the device is lost before the queue value is reached, the held signal is dropped, since
signalling then would break the same rule. Until a held signal is applied, GetCompletedValue reads the GPU's
progress.
d3d12_fence_timing_test: a queue Signal kept pending by a Wait on a gate fence, a CPU Signal above it (held, then
applied), and two CPU signals held behind one queue signal (applied in order). Fails on main's Fence at the first
check: the event for the CPU value fired while the queue signal was still pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_subresource_copy_test runs the same 117 steps on the Vulkan-backed device
and on the host runtime: textures in write-back and write-combine custom heaps,
a volume, an array, BC1 blocks, a buffer, an upload-heap buffer, a default-heap
texture and a multisampled one; whole and boxed copies, boxes outside, empty,
inverted or cutting a block, subresources past the last, pitches too small or
0, and copies before Map. It records every HRESULT and a hash of the whole
destination of every read, once per copy path (host image copy and staging).
On main 17 steps differed (RTX 3060, driver 610.88); now none do. The host's
rules:
- a box is refused only when its right, bottom or back edge lies past the
mip's, or it cuts a compressed block; an empty or inverted box that passes
those checks is S_OK and copies nothing (the layer refused it);
- the row and depth pitches are not checked: rows or slices that overlap are
copied in order (the layer refused a pitch smaller than a row or slice).
Not compared, and reported as such: null data (the host faults; the layer
still answers E_INVALIDARG), which bytes win when a read's rows overlap (the
driver's copy order, tiled on NVIDIA), and a default-heap texture, which the
host refuses and the layer copies on purpose, as docs/d3d12_vulkan.md says.
d3d12_vulkan_device_test's cpu_copies expected the old refusals for an empty
box and overlapping slices, and now expects S_OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/rootsig_census.py joins the 29 RTS0 signatures in amd_fidelityfx_upscaler_xbox.dll with the USER_SGPR count
each of their compute programs was launched with, under both user-data packing models. The surplus is constant (2
dwords or 4), so the arithmetic alone does not choose between them, but the s4 CS pointer base in the corpus census
does. docs/d3d12_vulkan.md records that as consistent with one dword per table rather than proof.
The layer gave the packed tail its tight linear size in whole tiles. AMD's PC
runtime gives it one tile per tile-depth slice it spans: ceil(depth of the
first packed mip / tile depth), so 1 for every 2D layout and a step at each
tile depth for volumes (8x8x32 R8: 1 tile, 8x8x33: 2, 8x8x256: 8), even where
the bytes would fit in fewer (16x16x128 RGBA8: 8 tiles for 3 tiles of data).
Measured on an RX 9070 XT (RDNA4, 32.0.31041.1004) and a Ryzen 7 9800X3D iGPU
(RDNA2, 32.0.21045.5002), identical on both: the rule fits all 83 layouts, the
47 from #868 (where it explains the two deep volumes AMD gave 2 tiles) and 36
new volumes whose tail is deeper than a tile, including tails that start after
standard mips. It matters once sparse textures (D3D-285) reach mip tails.
- src/resource_tiling.h: packed tiles = max(1, tight size, tail depth slices).
- resource_tiling_test: the two deep volumes expect 2, plus the 36 new volumes
with AMD's values.
- docs/d3d12_vulkan.md 4.2: the rule and the measurement.
AI-assisted (Claude Code).
D3D-316: copy the validated Python 4KB_S and 64KB_D bit patterns into a bounded, portable helper. Cover padded bijections, round trips, Python known offsets and invalid inputs without a GPU.
AI-assisted.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>