Shaders: lower MSAA image_load and image_get_resinfo #328
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/328"
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:20:00Z.
Support
2DMS(dim = 6) and2DMSArray(dim = 7) image dimensions forimage_loadandimage_get_resinfoincrates/victory-shader/src/emit/lower.rs:dim = 6 => (3, 2)anddim = 7 => (8, 3)inimage()forimage_loadandimage_get_resinfo.image_get_resinfo(op 72), passundefas themipargument ofdx.op.getDimensionsfor MSAA (kind3 | 8) and treat2DMS(kind = 3) as[true, true, false, true](width, height, -, sample count).image_load(op 66), forwardsample_index(addr_val(self, coords)) into themipLevelOrSampleparameter ofdx.op.textureLoad.msaa_image_load_and_get_resinfo_lowercoveringimage_loadandimage_get_resinfofor bothdim = 6anddim = 7.Verification
cargo test -p victory-shader(57/57 passed on macOS; Windowsdxil.dllvalidation not run)rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs(ok)cargo xtask policy(ok)Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:21:05Z.
Tested PR #328 at head
6d7602daf690bd5ec6d3b7ecac653a2e3bf7b9f0(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at6d7602daf690bd5ec6d3b7ecac653a2e3bf7b9f0.cargo test --locked -p victory-shader msaa_image_load_and_get_resinfo_lower— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 69 filtered out; finished in 0.00s ); cases: emit::lower::tests::msaa_image_load_and_get_resinfo_lower.Behavior covered: Checks MSAA image_load and image_get_resinfo lowering in the shader emitter.
Code: crates/victory-shader/src/emit/lower.rs
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T11:18:53Z.
Rebased onto
main(ffe310e) in91e7742and updatedmsaa_image_load_and_get_resinfo_lowerfor the newresource::tracksignature.cargo test -p victory-shader(97 passed, 0 failed on macOS).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:28:08Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflict incrates/victory-shader/src/emit/lower.rs). It will be reviewed again once it is rebased.From the earlier needs-work note, still open: a source for channel w = 1 of MSAA
image_get_resinfo, a comment that says what the code does, and a test that asserts the emittedtextureLoad/getDimensionsarguments.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-25T00:40:03Z.
Addressed the triage feedback:
image_get_resinfo(op 72), MSAA (kind = 3 | 8) now returns1in channelw(matching RDNA2IMAGE_GET_RESINFOmip count, rather than passing through DXIL's sample count).// shortcut:onimage_loadMSAA (forwarding fragment index as sample index, assuming no FMASK remapping).msaa_image_load_and_get_resinfo_lowerto match the encoded words and added an assertion on the emittedSFI0RESOURCE_HEAPfeature bit.cargo test -p victory-shader(119 passed, 0 failed on macOS;dxil.dllvalidation still needs Windows).Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T05:58:01Z.
Windows SDK validation of the four MSAA cases is complete. There is one fixture update needed when refreshing this branch onto main.
940d32f6,cargo test --frozen -p victory-shader --lib --no-runbuilds. Merging62baee73cleanly onto it produces tree287c3390, where the test target fails to compile: E0063, missingview_marksin the newPartsinitializer inmsaa_image_load_and_get_resinfo_lower.view_marks: false,locally to that initializer, matching the neighboring fixtures. The regression test then passed. I also passed a copy of each emitted DXIL container to the repo's validator wrapper with the x64 Windows SDK 10.0.26100.0dxil.dllexplicitly loaded. All four returned success: dimensions 6 and 7, each withimage_loadandimage_get_resinfo.This checks DXIL validation. Sample selection and returned dimensions were not measured on a GPU. AI-assisted; the fixture adjustment and validator call were local only.
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.