gpu: read slot 57 blend state from the colour-blend register words #1287

Merged
JohnConnorNPC merged 6 commits from upstream-pr/1294 into main 2026-11-24 08:57:24 +00:00
JohnConnorNPC commented 2026-11-24 07:01:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-24T07:01:49Z.


Refs #1216, #1150.

This is the draw-path hookup #1216 lists as open: the decoder is on main through #1226 and the register location was measured there by @rasptum. @rasptum was invited to do the wiring, and main development has a local integration; if either is about to land, close this in favour of it. I am posting it because I needed it for a run and no PR had it.

Problem

Translated pipelines created through device slot 57 get no blend state. find_blend looks for a desktop D3D12_BLEND_DESC in the captured blocks; state block A holds CB_BLENDn_CONTROL words instead. Glyph quads and other alpha-blended UI are drawn opaque.

Change

src/startup_stubs/state_block_blend.h: state_block_blend reads the eight words at state block A +0xD0, decodes each with x2w_cb_blend::decode(word, 0xF, false) and fills a D3D12_BLEND_DESC with independent blend.

  • The write mask stays at all four channels: CB_TARGET_MASK is not located.
  • A refused word on render target 0 returns false with the decoder's reason. The pipeline stays opaque, as before, and the reason is logged.
  • A refused word on targets 1-7 leaves that target unblended and sets its bit in refused_targets, which is logged.

d3d12_draw.inl calls it for a base pipeline of path 57, after the derived description and the stream subobject and before the find_blend scans. The log line names the source as colour-blend registers at +0xd0.

Alpha blend factor support is passed as false, so the constant-alpha factors are refused rather than queried.

Evidence

Commit under test: the head of this branch, on main at 93cb6a2a.

Device-free check (tests/startup_state_block_blend_check.cpp, registered as startup_state_block_blend):

startup_state_block_blend: PASS (4 measured words, enable clear, 5 controls)

It builds synthetic 388-byte state blocks filled with unrelated bytes, with the words at +0xD0:

  • the four words from #1216 (0xE5040504, 0xE5010504, 0xE5010501, 0xE1000104) give straight alpha, straight colour with ONE alpha, premultiplied and additive on target 0, with targets 1-7 unblended and unmasked;
  • ENABLE clear answers an unblended state;
  • controls: the block read four bytes late does not give a blended target 0; a block that ends before the eighth word and a null block are refused without writing the output; BOTH_SRC_ALPHA on target 0 is refused with a reason; the same form on targets 1-7 keeps target 0 and reports 0xFE.

Whole-program run. One console executable under the startup debugger, offline; Linux host, Wine with vkd3d-proton, NVIDIA RTX 4070 Ti SUPER. Measured with a local build that has the same hookup inline (not this branch's header):

  • Before: on a setup page, the heading is readable and the body text and option label are drawn as solid boxes.
  • After: the same page is fully readable, including lowercase body text and the two button prompts. Ten slot 57 or slot 55 pipelines logged blend from colour-blend registers, with source/destination factors SRC_ALPHA / INV_SRC_ALPHA or ONE / INV_SRC_ALPHA.

Also ran python -B tests/docs_links_check.py (pass) and git diff --check (clean).

Not included

  • The source-built draw #1216 asks for, one that goes through a slot 57 pipeline and tells blended from opaque output. The decoder's own draws (startup_cb_blend_*) already cover the register fields against a CPU model; what is missing is the creation path. I do not have a Windows host to build and run a D3D12 fixture on, so I have left it out rather than submit one I could only run through a translation layer. If that makes this unmergeable as it stands, the header and its check can be folded into whichever PR adds the draw.
  • Derived pipelines. A slot 55 pipeline uses its base's state block here. #1273 changes how derived pipelines pick their blend and touches the same lines of d3d12_draw.inl; this will need a rebase after it.

Not measured

  • Windows. The check was compiled with clang-cl against the Windows SDK and run under Wine; d3d12_xs_device.cpp was syntax-checked the same way. CI is the first MSVC build.
  • This branch's header has not been through a whole-program run; the inline equivalent has.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6576480863 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-24T07:01:49Z. --- Refs #1216, #1150. This is the draw-path hookup #1216 lists as open: the decoder is on `main` through #1226 and the register location was measured there by @rasptum. @rasptum was invited to do the wiring, and main development has a local integration; if either is about to land, close this in favour of it. I am posting it because I needed it for a run and no PR had it. ## Problem Translated pipelines created through device slot 57 get no blend state. `find_blend` looks for a desktop `D3D12_BLEND_DESC` in the captured blocks; state block A holds `CB_BLENDn_CONTROL` words instead. Glyph quads and other alpha-blended UI are drawn opaque. ## Change `src/startup_stubs/state_block_blend.h`: `state_block_blend` reads the eight words at state block A `+0xD0`, decodes each with `x2w_cb_blend::decode(word, 0xF, false)` and fills a `D3D12_BLEND_DESC` with independent blend. - The write mask stays at all four channels: `CB_TARGET_MASK` is not located. - A refused word on render target 0 returns false with the decoder's reason. The pipeline stays opaque, as before, and the reason is logged. - A refused word on targets 1-7 leaves that target unblended and sets its bit in `refused_targets`, which is logged. `d3d12_draw.inl` calls it for a base pipeline of path 57, after the derived description and the stream subobject and before the `find_blend` scans. The log line names the source as `colour-blend registers at +0xd0`. Alpha blend factor support is passed as false, so the constant-alpha factors are refused rather than queried. ## Evidence Commit under test: the head of this branch, on `main` at `93cb6a2a`. **Device-free check** (`tests/startup_state_block_blend_check.cpp`, registered as `startup_state_block_blend`): ``` startup_state_block_blend: PASS (4 measured words, enable clear, 5 controls) ``` It builds synthetic 388-byte state blocks filled with unrelated bytes, with the words at `+0xD0`: - the four words from #1216 (`0xE5040504`, `0xE5010504`, `0xE5010501`, `0xE1000104`) give straight alpha, straight colour with ONE alpha, premultiplied and additive on target 0, with targets 1-7 unblended and unmasked; - ENABLE clear answers an unblended state; - controls: the block read four bytes late does not give a blended target 0; a block that ends before the eighth word and a null block are refused without writing the output; `BOTH_SRC_ALPHA` on target 0 is refused with a reason; the same form on targets 1-7 keeps target 0 and reports `0xFE`. **Whole-program run.** One console executable under the startup debugger, offline; Linux host, Wine with vkd3d-proton, NVIDIA RTX 4070 Ti SUPER. Measured with a local build that has the same hookup inline (not this branch's header): - Before: on a setup page, the heading is readable and the body text and option label are drawn as solid boxes. - After: the same page is fully readable, including lowercase body text and the two button prompts. Ten slot 57 or slot 55 pipelines logged `blend from colour-blend registers`, with source/destination factors `SRC_ALPHA / INV_SRC_ALPHA` or `ONE / INV_SRC_ALPHA`. Also ran `python -B tests/docs_links_check.py` (pass) and `git diff --check` (clean). ## Not included - **The source-built draw #1216 asks for**, one that goes through a slot 57 pipeline and tells blended from opaque output. The decoder's own draws (`startup_cb_blend_*`) already cover the register fields against a CPU model; what is missing is the creation path. I do not have a Windows host to build and run a D3D12 fixture on, so I have left it out rather than submit one I could only run through a translation layer. If that makes this unmergeable as it stands, the header and its check can be folded into whichever PR adds the draw. - **Derived pipelines.** A slot 55 pipeline uses its base's state block here. #1273 changes how derived pipelines pick their blend and touches the same lines of `d3d12_draw.inl`; this will need a rebase after it. ## Not measured - **Windows.** The check was compiled with clang-cl against the Windows SDK and run under Wine; `d3d12_xs_device.cpp` was syntax-checked the same way. CI is the first MSVC build. - This branch's header has not been through a whole-program run; the inline equivalent has.
tedin7 commented 2026-11-24 08:01:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:15:40Z.

Review: COMMENTED


Reviewed at commit e0b2e8678aebd7e0f5aec8900a009df08e16003d.

Linux Checks

  • git diff --check origin/main...HEAD: passed (no whitespace/conflict-marker issues).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 286 links.).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1081 tracked source, script and build/CI files: no bidirectional controls.).

Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)

  • Debug (--preset dev):
    • cmake --build --preset dev --target startup_state_block_blend_check -- -j 6 (3.94s, configure 1.51s)
    • ctest --preset dev -R '^startup_state_block_blend$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed (0.09s: startup_state_block_blend 0.02s)
  • Release /O2 (--preset release):
    • cmake --build --preset release --target startup_state_block_blend_check -- -j 6 (1.43s, configure 1.48s)
    • ctest --preset release -R '^startup_state_block_blend$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed (0.09s: startup_state_block_blend 0.02s)

Code Review Notes

  • src/startup_stubs/state_block_blend.h: bounds check (bytes < state_block_blend_offset + 8 * sizeof(std::uint32_t)), std::memcpy word reads, and leaving *out untouched on target-0/short-block refusal are clean and avoid unaligned access UB.
  • src/startup_stubs/d3d12_draw.inl: slot 57 state_block_blend sits cleanly between has_stream_blend and the find_blend fallbacks, and logs refusals on target 0 or secondary targets (refused_targets). Note that alpha_factor_supported is passed as false (conservative unless D3D12_FEATURE_DATA_D3D12_OPTIONS13::AlphaBlendFactorSupported is queried later), and as documented in docs/startup-runtime.md, a live draw through a slot 57 pipeline remains open.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035129665 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294#pullrequestreview-6035129665). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T07:15:40Z. **Review:** COMMENTED --- Reviewed at commit `e0b2e8678aebd7e0f5aec8900a009df08e16003d`. ### Linux Checks - `git diff --check origin/main...HEAD`: passed (no whitespace/conflict-marker issues). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (`Checked 16 Markdown files and 286 links.`). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (`Checked 1081 tracked source, script and build/CI files: no bidirectional controls.`). ### Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) - **Debug (`--preset dev`)**: - `cmake --build --preset dev --target startup_state_block_blend_check -- -j 6` (`3.94s`, configure `1.51s`) - `ctest --preset dev -R '^startup_state_block_blend$' --parallel 4 --no-tests=error --output-on-failure`: **1/1 passed** (`0.09s`: `startup_state_block_blend` `0.02s`) - **Release `/O2` (`--preset release`)**: - `cmake --build --preset release --target startup_state_block_blend_check -- -j 6` (`1.43s`, configure `1.48s`) - `ctest --preset release -R '^startup_state_block_blend$' --parallel 4 --no-tests=error --output-on-failure`: **1/1 passed** (`0.09s`: `startup_state_block_blend` `0.02s`) ### Code Review Notes - `src/startup_stubs/state_block_blend.h`: bounds check (`bytes < state_block_blend_offset + 8 * sizeof(std::uint32_t)`), `std::memcpy` word reads, and leaving `*out` untouched on target-0/short-block refusal are clean and avoid unaligned access UB. - `src/startup_stubs/d3d12_draw.inl`: slot 57 `state_block_blend` sits cleanly between `has_stream_blend` and the `find_blend` fallbacks, and logs refusals on target 0 or secondary targets (`refused_targets`). Note that `alpha_factor_supported` is passed as `false` (conservative unless `D3D12_FEATURE_DATA_D3D12_OPTIONS13::AlphaBlendFactorSupported` is queried later), and as documented in `docs/startup-runtime.md`, a live draw through a slot 57 pipeline remains open.
upstream-sync closed this pull request 2026-11-24 09:04:24 +00:00
R0Y00 commented 2026-11-24 09:04:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:07:54Z.

Review: CHANGES_REQUESTED


The state-block decoder checks are useful. Please add a source-built slot 57 draw before landing the production hookup: read back a known background plus a translucent source, and confirm that the same draw with the blend word disabled or read from the adjacent offset produces a different pixel. Keep the write-mask limitation explicit. Please also exercise a bound secondary target with an unsupported factor; a log plus opaque rendering would silently change that target's output, so the fixture should show that the unsupported state is rejected or stays on an already verified path.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035677842 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294#pullrequestreview-6035677842). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T08:07:54Z. **Review:** CHANGES_REQUESTED --- The state-block decoder checks are useful. Please add a source-built slot 57 draw before landing the production hookup: read back a known background plus a translucent source, and confirm that the same draw with the blend word disabled or read from the adjacent offset produces a different pixel. Keep the write-mask limitation explicit. Please also exercise a bound secondary target with an unsupported factor; a log plus opaque rendering would silently change that target's output, so the fixture should show that the unsupported state is rejected or stays on an already verified path.
tedin7 commented 2026-11-24 09:04:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:42:54Z.

Review: COMMENTED


Retested at commit b1382a66f62025829bb4fb0fd048e95e6516d3e3 (4 new commits since e0b2e867).

Linux Checks

  • git diff --check origin/main...HEAD: passed (no whitespace/conflict-marker issues).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 294 links.).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1111 tracked source, script and build/CI files: no bidirectional controls.).

Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)

  • Debug (--preset dev):
    • Build (startup_state_block_blend_check, startup_stream_consumer): 24.80s (configure 1.46s)
    • ctest --preset dev -R '^(startup_state_block_blend|startup_slot57_blend_draw_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (startup_state_block_blend 0.01s, startup_slot57_blend_draw_warp 1.15s)
  • Release /O2 (--preset release):
    • Build: 36.45s (configure 1.56s)
    • ctest --preset release -R '^(startup_state_block_blend|startup_slot57_blend_draw_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (startup_state_block_blend 0.01s, startup_slot57_blend_draw_warp 1.26s)

Retest Findings

  • src/startup_stubs/state_block_blend.h: now refuses the entire block when any of the eight targets is refused (if (refused) return false;), leaving *out untouched so d3d12_draw.inl keeps its prior path and logs colour-blend registers not used: ...; refused targets 0x....
  • tests/startup_slot57_blend_draw_check.py (startup_slot57_blend_draw_warp): verified on WARP — exercises a source-built slot 57 draw reading back 8x4 RGBA8 pixels ((128, 0, 128, 191) blended vs (255, 0, 0, 128) unblended, (0, 0, 255, 255) background), ENABLE clear and +0xCC/+0xD4 offset controls, two-target MRT per-target words, and a refused secondary target (BOTH_SRC_ALPHA, 0x4000050b) leaving both targets unblended and logging refused targets 0x2.
  • docs/startup-runtime.md: keeps the CB_TARGET_MASK write-mask limitation explicit.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6036089941 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294#pullrequestreview-6036089941). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T08:42:54Z. **Review:** COMMENTED --- Retested at commit `b1382a66f62025829bb4fb0fd048e95e6516d3e3` (4 new commits since `e0b2e867`). ### Linux Checks - `git diff --check origin/main...HEAD`: passed (no whitespace/conflict-marker issues). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (`Checked 16 Markdown files and 294 links.`). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (`Checked 1111 tracked source, script and build/CI files: no bidirectional controls.`). ### Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) - **Debug (`--preset dev`)**: - Build (`startup_state_block_blend_check`, `startup_stream_consumer`): `24.80s` (configure `1.46s`) - `ctest --preset dev -R '^(startup_state_block_blend|startup_slot57_blend_draw_warp)$' --parallel 4 --no-tests=error --output-on-failure`: **2/2 passed** (`startup_state_block_blend` `0.01s`, `startup_slot57_blend_draw_warp` `1.15s`) - **Release `/O2` (`--preset release`)**: - Build: `36.45s` (configure `1.56s`) - `ctest --preset release -R '^(startup_state_block_blend|startup_slot57_blend_draw_warp)$' --parallel 4 --no-tests=error --output-on-failure`: **2/2 passed** (`startup_state_block_blend` `0.01s`, `startup_slot57_blend_draw_warp` `1.26s`) ### Retest Findings - `src/startup_stubs/state_block_blend.h`: now refuses the entire block when any of the eight targets is refused (`if (refused) return false;`), leaving `*out` untouched so `d3d12_draw.inl` keeps its prior path and logs `colour-blend registers not used: ...; refused targets 0x...`. - `tests/startup_slot57_blend_draw_check.py` (`startup_slot57_blend_draw_warp`): verified on WARP — exercises a source-built slot 57 draw reading back 8x4 RGBA8 pixels (`(128, 0, 128, 191)` blended vs `(255, 0, 0, 128)` unblended, `(0, 0, 255, 255)` background), `ENABLE` clear and `+0xCC`/`+0xD4` offset controls, two-target MRT per-target words, and a refused secondary target (`BOTH_SRC_ALPHA`, `0x4000050b`) leaving both targets unblended and logging `refused targets 0x2`. - `docs/startup-runtime.md`: keeps the `CB_TARGET_MASK` write-mask limitation explicit.
R0Y00 commented 2026-11-24 09:04:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:57:05Z.

Review: APPROVED


Release passed seven tests on RTX 4060 Laptop and WARP with no skips. The source-built slot 57 draw distinguishes the blended, opaque and shifted controls. Refused secondary state keeps the existing pipeline path. The independent write-mask work stays open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6036267190 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294#pullrequestreview-6036267190). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T08:57:05Z. **Review:** APPROVED --- Release passed seven tests on RTX 4060 Laptop and WARP with no skips. The source-built slot 57 draw distinguishes the blended, opaque and shifted controls. Refused secondary state keeps the existing pipeline path. The independent write-mask work stays open.
JohnConnorNPC commented 2026-11-24 09:04:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-24T08:30:12Z.


Both done in b1382a66.

Draw fixture. tests/startup_slot57_blend_draw_check.py (registered as startup_slot57_blend_draw_warp / _hardware) creates a pipeline through device slot 57 from source-built gfx1013 shaders and a synthetic state block A, clears an 8x4 RGBA8 target to opaque blue, draws red with alpha 0.5 over the left half and reads every pixel back. The right half must still be the background in every case.

Case State block A Drawn pixel
blend word 0x40000504 at +0xD0 (SRC_ALPHA / INV_SRC_ALPHA) (127, 0, 128, 191), expected (128, 0, 128, 191) ± 1
ENABLE clear 0x00000504 at +0xD0 (255, 0, 0, 127), the unblended source
adjacent offset, before 0x40000504 at +0xCC (255, 0, 0, 127)
adjacent offset, after 0x40000504 at +0xD4 (255, 0, 0, 127)

Each control is also asserted to differ from the blended pixel. The one-step tolerance is for alpha 0.5, which lands between two UNORM values.

Secondary target with an unsupported factor. You were right that a log plus an opaque target changes that target's output. state_block_blend now refuses the whole block when the decoder refuses the word of any target, reports every refused target, and substitutes nothing. The pipeline then stays on the path it had before this PR. The fixture binds a second RGBA8 target and exports to both:

Case Words Target 0 Target 1 Blend source in the log
both words +0xD0, +0xD4 = 0x40000504 (127, 0, 128, 191) (127, 0, 128, 191) colour-blend registers
target 1 ENABLE clear +0xD4 = 0 (127, 0, 128, 191) (255, 0, 0, 127) colour-blend registers
target 1 refused +0xD4 = 0x4000050B (BOTH_SRC_ALPHA) (255, 0, 0, 127) (255, 0, 0, 127) none

The refused case asserts that the registers did not supply the blend state, that the log names the reason and refused targets 0x2, and that both targets read the unblended source, so target 0 is not blended next to an opaque target 1. The unit test's "refused other targets" case is changed to match: refused, output untouched, refused == 0xFE.

Write mask. Still not located and not covered; the header, the docs, and the fixture's docstring and PASS line all say so.

Results here at b1382a66 (clang-cl build under Wine 11.0 with vkd3d-proton, RTX 4070 Ti SUPER; translation-layer, hardware only):

startup_state_block_blend: PASS (4 measured words, enable clear, 5 controls)
startup_slot57_blend_draw: PASS on hardware (blended (127, 0, 128, 191), 3 single-target controls, per-target words, refused second target leaves the registers unused; write mask not covered)

startup_stream_draw_check.py hardware still passes unchanged (the consumer gained a mode and the harness an optional second target).

Not verified: Windows and WARP for the new fixture; CI will be its first WARP run. The fixture does not show which path a real slot 57 pipeline takes when a block is refused, only that the registers are then left unused.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7126213001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1294#issuecomment-7126213001). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-24T08:30:12Z. --- Both done in `b1382a66`. **Draw fixture.** `tests/startup_slot57_blend_draw_check.py` (registered as `startup_slot57_blend_draw_warp` / `_hardware`) creates a pipeline through device slot 57 from source-built gfx1013 shaders and a synthetic state block A, clears an 8x4 RGBA8 target to opaque blue, draws red with alpha 0.5 over the left half and reads every pixel back. The right half must still be the background in every case. | Case | State block A | Drawn pixel | |---|---|---| | blend word | `0x40000504` at +0xD0 (SRC_ALPHA / INV_SRC_ALPHA) | (127, 0, 128, 191), expected (128, 0, 128, 191) ± 1 | | ENABLE clear | `0x00000504` at +0xD0 | (255, 0, 0, 127), the unblended source | | adjacent offset, before | `0x40000504` at +0xCC | (255, 0, 0, 127) | | adjacent offset, after | `0x40000504` at +0xD4 | (255, 0, 0, 127) | Each control is also asserted to differ from the blended pixel. The one-step tolerance is for alpha 0.5, which lands between two UNORM values. **Secondary target with an unsupported factor.** You were right that a log plus an opaque target changes that target's output. `state_block_blend` now refuses the whole block when the decoder refuses the word of *any* target, reports every refused target, and substitutes nothing. The pipeline then stays on the path it had before this PR. The fixture binds a second RGBA8 target and exports to both: | Case | Words | Target 0 | Target 1 | Blend source in the log | |---|---|---|---|---| | both words | +0xD0, +0xD4 = `0x40000504` | (127, 0, 128, 191) | (127, 0, 128, 191) | colour-blend registers | | target 1 ENABLE clear | +0xD4 = 0 | (127, 0, 128, 191) | (255, 0, 0, 127) | colour-blend registers | | target 1 refused | +0xD4 = `0x4000050B` (BOTH_SRC_ALPHA) | (255, 0, 0, 127) | (255, 0, 0, 127) | none | The refused case asserts that the registers did not supply the blend state, that the log names the reason and `refused targets 0x2`, and that both targets read the unblended source, so target 0 is not blended next to an opaque target 1. The unit test's "refused other targets" case is changed to match: refused, output untouched, `refused == 0xFE`. **Write mask.** Still not located and not covered; the header, the docs, and the fixture's docstring and PASS line all say so. **Results here** at `b1382a66` (clang-cl build under Wine 11.0 with vkd3d-proton, RTX 4070 Ti SUPER; translation-layer, `hardware` only): ``` startup_state_block_blend: PASS (4 measured words, enable clear, 5 controls) startup_slot57_blend_draw: PASS on hardware (blended (127, 0, 128, 191), 3 single-target controls, per-target words, refused second target leaves the registers unused; write mask not covered) ``` `startup_stream_draw_check.py hardware` still passes unchanged (the consumer gained a mode and the harness an optional second target). **Not verified:** Windows and WARP for the new fixture; CI will be its first WARP run. The fixture does not show which path a real slot 57 pipeline takes when a block is refused, only that the registers are then left unused.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1287
No description provided.