Shaders: cube face and multisampled image loads #1954
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1956"
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 RaghavVijayanand on 2026-11-25T01:45:16Z.
The translator refused image accesses on cube and MSAA dimensions except for sampling ("an image dimension (cube loads or MSAA)"). Two commits.
Cube (dim 3)
image_get_resinfo: the handle is now a 2D array (kind 7). D3D12 has no cube UAVs, so a UAV over a cube is a 2D-array view with the faces as slices, which matches GFX10's (x, y, face) addressing. Before, resinfo used an invalid cube-UAV kind.sampleLevelat the texel's centre on that face, through a new clamped point immediate sampler.cube_load: out-of-range reads clamp instead of returning zero, cube arrays are not handled, and integer formats can't be sampled.MSAA (dims 6 and 7)
image_loadbecomes textureLoad on Texture2DMS (kind 3) or Texture2DMSArray (kind 8), with the sample index as the sample operand. The console's last address is the fragment index, which equals the sample unless FMASK remaps it; this is noted in the code.image_get_resinforeturns width, height and layers.image_msaa_load, MSAA stores, atomics, sampling andimage_load_mip, and the 4th resinfo channel.Tests: the new
emit/image_dim_tests.rs(7 tests) covers:image_atomic_addon a 2D-array UAVEach program is validated with dxil.dll and run on the default hardware adapter and WARP. Swapping the face coordinates, leaving the UAV handle as a cube, or zeroing the sample operand each makes tests fail. The cube mip test uses main's
View::MippedCube; the test host gains only 2D-array UAVs and the multisampled depth view.Not covered: main's newer descriptor-as-data path (
descriptor_datainlower.rs) still refuses cube and MSAA ("an image dimension (cube or MSAA)"). This PR does not touch it.This PR and #1955 (image stores) both touch
image()inemit/lower.rs, so merging both needs a small manual merge.Rebased onto current main (
940d32f). On this machine, 5 tests fail on main itself, with or without this change:descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views, the twostride_tests::a_heap_buffer_read_*tests, andsynthetic_tests::gathers_at_a_level_match_the_hardware. Everything else passes, and clippy passes with-D warnings, with and without--all-features.Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T01:45:31Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:19:11Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/host.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:14:10Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. Cube face and multisampled image loads — texture-dimension coverage for cube/MSAA paths.
Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T04:23:38Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
2e7466c.cargo test --workspace --locked --no-fail-fast-> all green: 0 passed, 0 ignored, 0 failed.Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T08:59:26Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
2e7466c.cargo test --workspace --locked --no-fail-fast-> 703 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:01:59Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
2e7466cfontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T11:32:37Z.
Rebased onto
main63bcca4. Two adjustments for whatmaingained since:dispatchtakesmain's WARP lock.root_signature_fortakes the lock as well, and it is not re-entrant, somultisampled_array_loads_read_the_slice_and_sample_asked_forhung on WARP.Each commit builds. On an RTX 5060 Laptop: the cube, multisampled, image store/atomic and
parallel_warp_pipelines_and_drawstests pass (11), on hardware and WARP. Clippy is clean.Imported from Marvisak/VIctory. Originally posted by oddmaniv on 2026-11-27T03:30:10Z.
Independent verification of the PR author's image-dimension tests at
8d1bdac43da2eac3c3efd0eb58bd76f1063635c9.cargo test --locked -p victory-shader --lib image_dim_tests -- --nocaptureMain baseline pin:
63bcca43c6a00a758510398fa43096ce7e4f7df0.Baseline limitation: The selected PR-added test is absent on unmodified main; a zero-match baseline would not be a pass.
Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.
AI-assisted verification.
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.