Skip to content

fix(shader): use integer typed-buffer overloads - #196

Merged
pragyaangaur merged 5 commits into
pragyaangaur:mainfrom
vedantdadhich21:fix/integer-typed-overloads
Nov 26, 2026
Merged

pragyaangaur merged 5 commits into
pragyaangaur:mainfrom
vedantdadhich21:fix/integer-typed-overloads

Conversation

@vedantdadhich21

Copy link
Copy Markdown
Contributor

Summary

Typed 32-bit UINT/SINT buffer accesses were emitted through bufferLoad.f32/bufferStore.f32 and bitcast afterward, relying on the driver to preserve mismatched component bits.

This branch:

The integer and float branches are mutually exclusive, with i32 phis joining load results so no mismatched overload executes.

Regressions

  • Structural DXIL test: both guarded overload sets are emitted for typed SRV/UAV loads and stores.
  • Synthetic SRV/UAV round trips cover FLOAT/UINT/SINT, RGB32/RGBA32 where supported, and 0xffffffff, 0x80000000, NaN patterns, 0, 1, and -1.
  • Typed-store offset and 4/8/12/16-byte page-mark regressions from fix(shader): reject typed store offsets and use real strides #181 remain green.
  • RGB32 integer metadata is covered in both production and synthetic host classifiers.

Verification

  • Native victory-shader: 167 passed, 2 ignored.
  • Windows/Wine typed tests: 7 passed, including offset, page-mark, metadata, structural, round-trip, and d16 coverage.
  • Strict Windows Clippy for victory-shader and victory-gpu, all targets/features: passed.
  • cargo xtask policy: 216 files ok.
  • git diff --check: passed.

DXIL validation was skipped because dxil.dll is unavailable. D3DMetal passed RGBA32 FLOAT/UINT/SINT; RGB32 D3DMetal view creation and WARP were unavailable, so those cases are skipped conditionally. No game files or proprietary assets were used. AI-assisted.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
Select bufferLoad.i32 and bufferStore.i32 for runtime UINT/SINT views using the view-kind metadata. Keep independently annotated float and integer handles in mutually exclusive branches so float views never execute a mismatched overload. Preserve the established d16 path for narrow formats.

Add structural DXIL coverage and synthetic SRV/UAV round trips for RGB32/RGBA32 UINT, SINT and FLOAT, including integer boundaries and NaN bit patterns. Skip known-broken RGB32 D3DMetal view creation while still querying WARP.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
…ze limit

lower.rs went over the 512 KiB limit of the asset policy with the typed-buffer changes. The tests move unchanged to lower/tests.rs; the policy is not touched.
@pragyaangaur
pragyaangaur merged commit 62a7fc9 into pragyaangaur:main Nov 26, 2026
1 check passed
@pragyaangaur

Copy link
Copy Markdown
Owner

I read the diff (it carries #181 and #177, which were already reviewed as sound), merged main into it and merged it. Changes I made on top: the new fields from #180 and #164 in the test initialisers and the Lowered struct, WARP skipping typed formats it does not support in the page boundary test (a CI WARP lost the device on RGB32F), and a move of the lowering tests from lower.rs to lower/tests.rs, unchanged, because lower.rs went past the 512 KiB limit of the asset policy (the policy itself is untouched). The shader suite passed under Wine with D3DMetal and CI is green. Thank you, and thanks for folding the two earlier PRs together.

@pragyaangaur pragyaangaur added area:gpu Host GPU runtime: resources, copies, presenting area:shader Shader translator bug Something isn't working labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Host GPU runtime: resources, copies, presenting area:shader Shader translator bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants