Skip to content

Shader tests: read back computed texture-table colors and marks - #7

Open
passerbyyhx wants to merge 1 commit into
BastienRodz:shader/computed-table-read-marksfrom
passerbyyhx:test/computed-table-readback
Open

passerbyyhx wants to merge 1 commit into
BastienRodz:shader/computed-table-read-marksfrom
passerbyyhx:test/computed-table-readback

Conversation

@passerbyyhx

Copy link
Copy Markdown

This runs the shader that reads a computed texture-table entry and checks its texel and the read-mark bitmap from the same dispatch. The existing test checks whether lowering requests marks for this path, then dispatches a heap-direct shader. This fixture uses 1×1 textures and a nonzero table base so the table-relative and absolute slot indices differ.

On a GeForce RTX 4090 Laptop GPU (driver 621.14) and Microsoft WARP, one computed pipeline per device gave these results. Only the table base and entry root constants changed between the three nonempty dispatches.

Table base Entry GPU color Only set bit in the test bitmap
2 0 Red VIEW_READS + 2
2 1 Blue VIEW_READS + 3
1 1 Red VIEW_READS + 2

A fixed-entry shader targeting base 2 read red for either entry and emitted no read mark. The zero-group control left both the output and bitmap clear. Restoring only lower.rs from 13f91ca preserved all colors on both adapters and removed the computed-entry marks. The assertion failed on the first missing bit. This isolates the change in marking independently of descriptor selection.

cargo test --locked -p victory-shader --lib emit::memory_tests::computed_table::computed_texture_table_entries_report_the_sampled_slots -- --exact --test-threads=1 --nocapture

The untouched test fixture was built in separate Cargo target directories for the PR and the rollback. The WARP memory test module passed 5/5. Strict package Clippy passed with all targets and features. The test measures shader output and the read bitmap. Runtime materialization and in-game use are outside its scope.

Related: Marvisak#2724

Code and hardware testing assisted by Codex.

@BastienRodz

Copy link
Copy Markdown
Owner

Thanks for this. I replied on Marvisak#2724: I'm keeping that PR small for review, and your readback is linked there as the hardware evidence. I'm leaving this open, and I'll merge it, with your authorship kept, if the maintainer wants the end-to-end test in the PR.

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