Apply typed blend patches to derived graphics pipelines #1266
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1273"
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 R0Y00 on 2026-11-24T06:25:19Z.
Refs #874 and #1216.
Device slot 55 previously retained only 256 bytes of its patch array. A single type-2 record needs 332 bytes, so a translated draw could use an ancestor's blend state even when the caller supplied a new one. Preserve the array at creation, use the last blend patch from the nearest derived pipeline and retain the existing shader lookup through the base. Empty patch lists are accepted. A nonempty unreadable list or more than 64 records returns
E_INVALIDARG.The source-built fixture goes through the guest device and command list, then reads back the target on a separate desktop queue. It exercises multiple type-2 records, a trailing sample-mask record and a further derivation without a blend patch. With a green shader, the parent preserves A8 at 0, the child writes 255, and R8 receives 0. A red shader writes 255 to R8. All four cases check all 32 bytes, including the untouched half.
The fixed record size and tag can be cross-checked against the XCL implementation at 64b3f35.
Windows verification
Tested
aae7a50con Windows 11 build 26200.9974 with the debug layer disabled. Adapters were NVIDIA GeForce RTX 4060 Laptop GPU (32.0.16.1656) and Microsoft Basic Render Driver (10.0.26100.9818).All three tests passed in 6.71 seconds, with zero skips. The existing red/green RGBA readbacks and swapped-shader control passed on both adapters.
After merging current main into this branch, candidate
1e744970retains the logical heap fixture added by #1255. Reranctest --test-dir out/build/release --no-tests=error --output-on-failure -R '^startup_(stream_(request_warp|draw_(hardware|warp))|logical_view_(hardware|warp))$'. Four tests passed in 8.99 seconds and the separate WARP logical-heap test returned its capability skip. Both derived blend readbacks passed.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:41:02Z.
Review: COMMENTED
Peer review at commit
1e74497020920761d8bf3f363206c5b685c7c8e7:Findings
src/startup_stubs/d3d12_xs_device.cpp&src/startup_stubs/derived_blend.h:device_create_derived_pipelinenow retainscount * 0x14cbytes (x2w_derived_blend::record_size) instead of truncating to 256 bytes, validatescount <= 64and readability of non-emptydesc(E_INVALIDARG), andx2w_derived_blend::last_blendscans backwards so the last tag-2 blend patch wins.src/startup_stubs/d3d12_draw.inl:translation_forwalks up to 8 derived ancestors and picks the blend patch from the nearest derived pipeline before falling back to stream/state-block blend state. (Existingdepth < 8bound is unchanged.)tests/startup_stream_consumer.cpp,tests/startup_stream_draw.cpp,tests/startup_stream_draw_check.py: Good negative/positive coverage—nullptrpatch pointer withcount = 1returningE_INVALIDARG, multiple tag-2 records, trailing tag-3 sample-mask record, grandchild inheritance, and exact 32-pixel A8/R8 readbacks with red/green shader controls.Verification
git diff --check origin/main...HEAD: clean/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 284 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1070 tracked source, script and build/CI files: no bidirectional controls)--preset dev):cmake --build --preset dev --target startup_stream_consumer -- -j 6(23.11s)ctest --preset dev -R '^startup_stream_(request_warp|draw_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (1.62s:startup_stream_request_warp1.25s,startup_stream_draw_warp1.56s)/O2(--preset release):cmake --build --preset release --target startup_stream_consumer -- -j 6(35.20s)ctest --preset release -R '^startup_stream_(request_warp|draw_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (1.69s:startup_stream_request_warp1.24s,startup_stream_draw_warp1.62s)