Shaders: pair packed fp16 pixel inputs with unlisted signature rows #176
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!176
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/176/head"
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?
@Yaekai on GitHub · 2026-11-24 01:07 UTC · original
Yaekai:feat/shader-half-inputs→main· +132 −7 · 1 files · 2 commits · closed without mergingIn
crates/victory-shader/src/emit/lower.rs, pixel shader inputs withfp16andpack2set sometimes leavePsInput.row2 == PsInput.roweven when a second 16-bit signature row is packed into the trailing channels of the same hardware attribute (for example,row 0withrow2 == 0packing unlistedrow 1, orrow 3withrow2 == 3packing unlistedrow 6). Previously,interp()treatedrow2 == rowas having no partner (None), causingemit: a packed input half no element holds.This mirrors the existing
half_outputspairing logic for pixel inputs via a newhalf_inputshelper:half && kind == 0) signature rows not named asi.rowby anyPsInputand not explicitly claimed asi.row2(wherei.row2 != i.row).fp16PsInputin row order: usesi.row2wheni.row2 != i.row, and otherwise pairspack2entries with the next available unlisted 16-bit signature row> i.row.packed_half_inputs_pair_unlisted_rowscovering explicitrow2preservation and unlisted-row fallback.Verification
cargo test -p victory-shader— 70/70 passed.rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs— clean.victory translate --validateonshaders.rpf(26,084 programs): reducedemit: a packed input half no element holdsfrom 172 → 6, increasing complete VS/PS shaders from 12,316 → 12,433 emitted (+117) and 12,208 → 12,325dxil.dll-validated (+117, 100% validation pass rate, 0 new validator errors).@DaviTostes on GitHub · 2026-11-24 01:19 UTC · original
Tested
a823dfbon Arch Linux x86_64, rustc 1.98.1: pass.cargo test -p victory-shader: 57 passed, 0 failed (2 test binaries), including the 1 test this PR adds.victory-gpuE0425.No game data used.
@Yaekai on GitHub · 2026-11-24 01:47 UTC · original
Thanks for the review @raffclar! Addressed all three points in
f0e7745:row2 == row: added comments explaining that in the console'sPsInputtable,row2repeatsrowwhen no distinct partner row is named.halvesbyi.rowkeeping the firstfp16entry (matching the previous.find()behaviour) so duplicates neither overwrite earlier entries nor consume an extra free partner row.r > i.row && r < next_fp16(the nextfp16input row) so an earlier unpairedfp16input cannot steal a laterfp16input's partner, while still allowing 32-bitPsInputrows in between (e.g.row 3pairing with unlistedrow 6across 32-bit rows 4–5).Added unit test coverage for both duplicate rows and the
next_fp16bound (cargo test -p victory-shader: 70/70 passed) and re-verifiedvictory translate --validateonshaders.rpf(still 172 → 6, +117 VS/PS emitted &dxil.dll-validated, 0 new validator errors).@slint6614-dev on GitHub · 2026-11-24 08:43 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate --pipelines(pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main1f858b0. Counts are emitted / validated / pipelines.#621 clears all 172 (+123 validated pixel programs); #176 and #592 give identical results (+117, 6 left). CS and MS unchanged in all three.
@justlovett0 on GitHub · 2026-11-24 18:48 UTC · original
Verified + integrated. Stack: main
ffe310e+ #175/#994/#747/#302/#193/#704/#309/#953/#1067/#986/#1260/#1267/#1254/#1276/#189 (wave64 emulation), RTX 3080 10 GB / Win10 21H2 (19044.7846) / driver 621.24 (32.0.16.2124). Re-census of captured runtime containers; world stable ~9 min, 0 device removals.Packed fp16 pixel-input pairing merged (runtime kept; a lower.rs test-module conflict resolved to our tests). No regressions; compute emission 493/560.
AI use: Qwen Code; local measurements. No game data posted.
@raffclar on GitHub · 2026-11-24 01:10 UTC · original · edited 2026-11-24 01:12 UTC
On
crates/victory-shader/src/emit/lower.rsline 352 (outdated):Do you really mean row2 == row == "no partner given" in the console format? Just needs clarifying this is pretty hard to read. Maybe a small STE100 comment on a line before the method chaining
@raffclar on GitHub · 2026-11-24 01:13 UTC · original
On
crates/victory-shader/src/emit/lower.rsline 363 (outdated):Also what about dupes. The old code used the first one and now this uses the last for dupes. Also each duplicate takes up a free row so later input can run out of partners.
@raffclar on GitHub · 2026-11-24 01:14 UTC · original
On
crates/victory-shader/src/emit/lower.rsline 358 (outdated):You should only use a free row that comes before the next named input row
@raffclar on GitHub · 2026-11-24 01:15 UTC · original
On
crates/victory-shader/src/emit/lower.rsline 358 (outdated):Otherwise an earlier input can take a free row that really belongs to a later input. Causes wrong row to be read or fails
Pull request closed