gpu: add a composite provenance fixture for retained clear colours #1635
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1642"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T15:37:59Z.
Refs #1628
A source-built two-pass D3D12 fixture for composite provenance: it shows whether a colour left in a composite's destination came from the composite or was already there. It is synthetic; nothing from the title is involved.
Fixture (
tests/startup_composite_provenance.cpp,.hlsl, mode--startup-composite-provenance)One command list, then one fence wait (
ComputeCommands::submit_and_wait, asstartup_cb_blenduses):R32G32B32A32_FLOATrender target is cleared to blue. It then gets a green centre block[16,48)²and a red corner block[0,8)², each drawn by a full-screen triangle under its own scissor.PIXEL_SHADER_RESOURCE.Loads the exact source texel atfloor(position) × scale + offset, so no filtering or rounding is involved. The viewport, scissor, write mask and UV come from the case; blending is off.A CPU model built from the source and before-composite readbacks predicts every after-composite pixel. A pixel inside the viewport and scissor takes the source texel in its written channels; every other pixel keeps the before value. The comparison is bit-exact.
The fixture also checks the inputs (source centre, corner and base, and the before centre), and that the three after-centres are pairwise distinct.
Breaking controls: each runs against the unchanged model of its case and must mismatch.
New CTests:
startup_composite_provenance_{hardware,warp}, plus the DXC header rules for the VS and the two pixel shaders.docs/startup-runtime.mdgains a "Composite provenance fixture" section.Results
4147ef23on141617bb. Windows 11 26H2, build 26300.9974. MSVC 19.44.35207, DXC 1.8.2502.11. D3D12 debug layer enabled,debug_errors=0 debug_warnings=0.32.0.31044.1610.0.26100.9818Both pass in the
devandreleasepresets, with no skips.startup_cb_blend_*and the newstartup_packed_screen_position_*(#1634) still pass alongside.AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:43:54Z.
Review: COMMENTED
Reviewed
4147ef2352bac44708c2529e643cbcb4d6ae5f15:tests/startup_composite_provenance.cppandtests/startup_composite_provenance.hlslcleanly implement the two-pass D3D12 provenance fixture on a single command list (ComputeCommands::submit_and_wait), usingsource.Load(int3(int2(position.xy) * scale + offset, 0))for exact texel addressing without filtering. Root signature layout (b08×32-bit constants matchingfloat4 fill + int2 scale + int2 offset, plust0SRV descriptor table), resource state transitions (RENDER_TARGET -> COPY_SOURCE -> PIXEL_SHADER_RESOURCEforsource,RENDER_TARGET -> COPY_SOURCE -> RENDER_TARGET -> COPY_SOURCEfordestination), bit-exactstd::memcmpverification against the CPU model, pairwise-distinct centre checks, and the two breaking controls (uv moved to the source centre,write mask red|alpha) are all sound.python3 tests/docs_links_check.py— passed (Checked 16 Markdown files and 348 links.)python3 tests/bidi_controls_check.py— passed (Checked 1268 tracked source, script and build/CI files: no bidirectional controls.)cmake --build --preset dev --target offscreen_check -- -j 6+ctest --preset dev -R '^startup_composite_provenance_' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (startup_composite_provenance_warp,startup_composite_provenance_hardware)./O2(cmake --build --preset release --target offscreen_check -- -j 6+ctest --preset release -R '^startup_composite_provenance_' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (startup_composite_provenance_hardware,startup_composite_provenance_warp).AI-assisted; commands listed were executed locally.