Skip to content

Check formatted root reads against their actual load width - #3

Open
MichaelSmithAI wants to merge 1 commit into
wbkepler:shader/root-view-boundsfrom
MichaelSmithAI:fix/formatted-root-load-width
Open

MichaelSmithAI wants to merge 1 commit into
wbkepler:shader/root-view-boundsfrom
MichaelSmithAI:fix/formatted-root-load-width

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

On the branch for VIctory #650, a formatted root-buffer load checks whether 16 bytes remain. A one-channel R32_UINT fetch at offset 60 of a 64-byte view only loads four bytes. On 06657a8 the GPU returned zero for that valid final field.

The change checks the byte width of the emitted raw load. For a sub-dword field it checks the aligned dword that contains the requested byte. The regression uses a 256-byte backing allocation and varies the logical view size independently.

Format and byte offset 64-byte view 63-byte view
R32_UINT at 60 271 0
R8_UINT at 61 1 0

The second row checks the complete four-byte load starting at byte 60. An RTX 4090 running D3D12 through Wine 11.22 and vkd3d-proton 3.1 produced all four expected results. The existing raw root-read test passed alongside the new formatted test. A second build from a clean checkout confirmed both GPU tests. The Linux shader suite passed 56 tests.

In a separate local integration on the bounded structured-root tester branch at 66ac451, the equivalent width correction preserves the branch around the memory instruction. All three GPU tests passed on the same adapter: the formatted SRV read, the raw SRV read, and the structured UAV load/store/atomic readback.

Run both GPU controls with cargo test --locked -p victory-shader --lib root_view_reads -- --nocapture --test-threads=1. Retail rendering impact remains unmeasured. AI-assisted implementation and review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants