Shaders: support cube dimension in descriptor_data #317
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/317"
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 Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T02:15:46Z.
Support cube (
dim = 3) image dimensions when a shader reads a resource descriptor's metadata words as data (descriptor_dataincrates/victory-shader/src/emit/lower.rs):dim = 3 => 5(TextureCube) indescriptor_data.depth = 6before- 1(yielding5, matching the RDNA2 ISA descriptor table for 6 faces) and add11(SQ_RSRC_IMG_CUBE) to the hardware type table in word 3.cube_descriptor_data_lowersverifyingSFI0RESOURCE_HEAPemission.Verification
cargo test -p victory-shader(119 passed, 0 failed, 1 ignored benchmark on macOS; Windowsdxil.dllvalidation not run)cargo xtask policy(ok)Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T03:09:02Z.
Review note on the MSAA case. For kinds 3 and 8 (MSAA) the level count is set to 1:
so the descriptor's last-level field comes out as 0. The RDNA 2 ISA's image resource table defines that field differently for MSAA:
Code that reads the sample count from the descriptor would get 1 sample. The host view's sample count is available (
getDimensionson aTexture2DMSreturns it), so the field could hold its log2.For the cube case, #109 hardcodes the depth field as 5, which matches the same table ("depth: ... last array slice for a 2D-array or 1D-array or cube-map"); here it is taken from
getDimensionscomponent 2, which aTextureCubedoes not expose, so the two PRs disagree and #109's value is the one the table gives.From the document and reading the diff only; I have no copy of the title.
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T11:18:52Z.
Rebased onto
main(ffe310e) and addressed @r4tedx's review notes in8133754:kind = 5)depthto5(6 faces - 1).kind = 3 | 8)last_leveltofirstbitLo(samples)(log2(samples)fromgetDimensionscomponent 3).cube_and_msaa_descriptor_data_lowerfor the newresource::tracksignature;cargo test -p victory-shader(97 passed, 0 failed on macOS).Imported from Marvisak/VIctory. Originally posted by Yaekai on 2026-11-24T16:38:24Z.
Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head
8133754:cargo test -p victory-shader --lib -- --skip valu_tests --skip waterfall_tests: 103 passed, 0 failed.cargo clippy -p victory-shader -- -D warnings: 0 warnings.1.0.2.1,--console series-s, 19-min world run): no regressions. Ready to merge![PR #317] Shaders: support cube and MSAA dimensions in descriptor_datato [PR #317] Shaders: support cube dimension in descriptor_dataImported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:30:45Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/bitcode.rsandcrates/victory-shader/src/emit/lower.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-25T00:34:25Z.
Addressed the triage feedback:
dim = 3,depth = 5,SQ_RSRC_IMG_CUBE = 11), dropping the unreachable MSAA arms (and thefirstbitLo.i32call) until MSAA image instructions lower.cube_descriptor_data_lowersand verifiedSFI0RESOURCE_HEAPemission.cargo test -p victory-shader(119 passed, 0 failed on macOS).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.