Shaders: unpack 16-bit vertex inputs into the low half #1519
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1519
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1519"
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?
@Bloh09 on GitHub · 2026-11-24 18:42 UTC · original
Bloh09:bloh09/shader-16bit-vertex-inputs→main· +132 −7 · 2 files · 2 commits · openUnpack 16-bit vertex attributes into the low half of the VGPR, the way the fetch shader leaves them. Host loadInput is 32-bit, so float16 goes through legacyF32ToF16 and integers are masked to 16 bits.
Part of #1512.
Tested on a Linux box with no GPU and no game files:
cargo test --frozen -p victory-shader(97 passed, 1 ignored) andcargo xtask policy(154 files ok). The new test fails on main with "a 16-bit input is not supported".Untested on hardware; would appreciate someone running a vertex shader with 16-bit inputs.
AI-assisted (Grok Bot), reviewed by me.
Skipped: packed fetch (two 16-bit values per dword). VsInput has no pack flags, so that stays refused until the stage data carries them.
@MichaelSmithAI on GitHub · 2026-11-24 18:53 UTC · original
The requested hardware check passed on
55bf86fwith an RTX 4090 under Wine/GE 3.2. The test input layout used actualR16_FLOAT,R16_SINT, andR16_UINTelements. The translated vertex shader converted each resulting VGPR word as an unsigned 32-bit integer to an exactly representable float, and a passthrough pixel shader exposed it for readback. Microsoft’s DXIL validator accepted the vertex shader.0x0000bb00,0x0000fb2e,0x0000fedc0x00003e00,0x00007fff,0x00008123In particular, the negative signed input retained its low 16 bits and cleared the upper half. This exercises unpacked inputs, one attribute per VGPR. Packed pairs and title rendering remain unmeasured.
@sinan-cmyk on GitHub · 2026-11-24 19:33 UTC · original
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count changes against
main, and the tests pass on Ada.Offline. I merged head 55bf86f onto
mainffe310e(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: 21,724 on both, 0 gained, 0 lost. No program changes its failure reason either.This is the expected result for a correctness fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests. With the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@geiyiliyabumo on GitHub · 2026-11-24 19:34 UTC · original
Verified commit
55bf86fon Windows 11 / AMD Radeon RX 9060 XT (RDNA4,gfx1200, SM 6.6) + WARP:cargo test -p victory-shader --lib: 121 passed, 0 failed, 1 ignored (all 16-bit vertex input unpacking and GPU tests pass).AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 03:29 UTC · original · edited 2026-11-25 16:06 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/bitcode.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
@Bloh09 on GitHub · 2026-11-25 03:43 UTC · original
Test now asserts the unpacked low-half values for float16 and int; victory-shader tests and policy pass on 2d3537f.
@Bloh09 on GitHub · 2026-11-25 04:05 UTC · original
Rebased on
940d32fand set view_marks in the test's Parts; victory-shader tests (145 pass), clippy and policy clean.@StExpeditus on GitHub · 2026-11-25 09:21 UTC · original
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
1f658a6.cargo test --workspace --locked --no-fail-fast-> 697 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.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.