Shaders: image_sample_o with constant offsets #634

Manually merged
github merged 1 commit from gh-pr/634/head into gh-pr/634/base 2026-11-26 04:10:48 +00:00
Owner

@⁠SAitken91 on GitHub · 2026-11-24 05:58 UTC · original
SAitken91:shader/image-sample-o → main · +31 −1 · 2 files · 1 commits · merged 2026-11-24 08:19 UTC

image_sample_o was refused by name. That blocked 4 pixel programs in shaders.rpf, for example PS_VolumeLight_Interleave_Reconstruction_Weighted.

Change

  • The offset dword (x in bits 0–5, y in 8–13, z in 16–21, signed 6-bit) becomes sample's immediate offsets when it is a constant within DXIL's −8..7.
  • A computed offset is still refused, as is one outside −8..7. The refusal now says which case it is.
  • New Module::int_value reads an integer constant's value.

Results

victory translate --validate shaders.rpf: vertex/pixel validated 12172 → 12176 (all four).

Testing

  • cargo test -p victory-shader: 69 passed. Clippy and rustfmt are clean.
  • Not exercised at runtime.

This is independent of my other open PRs (#539, #554, #563, #565, #569, #571, #592).

Written with the help of Claude (AI).

🤖 Generated with Claude Code

**@⁠SAitken91** on GitHub · 2026-11-24 05:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/634) `SAitken91:shader/image-sample-o` → `main` · +31 −1 · 2 files · 1 commits · merged 2026-11-24 08:19 UTC `image_sample_o` was refused by name. That blocked 4 pixel programs in shaders.rpf, for example `PS_VolumeLight_Interleave_Reconstruction_Weighted`. ## Change - The offset dword (x in bits 0–5, y in 8–13, z in 16–21, signed 6-bit) becomes `sample`'s immediate offsets when it is a constant within DXIL's −8..7. - A computed offset is still refused, as is one outside −8..7. The refusal now says which case it is. - New `Module::int_value` reads an integer constant's value. ## Results `victory translate --validate shaders.rpf`: vertex/pixel validated 12172 → 12176 (all four). ## Testing - `cargo test -p victory-shader`: 69 passed. Clippy and rustfmt are clean. - Not exercised at runtime. This is independent of my other open PRs (#539, #554, #563, #565, #569, #571, #592). Written with the help of Claude (AI). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
image_sample_o was refused by name. Its offset dword (x in bits 0-5, y
in 8-13, z in 16-21, signed) becomes sample's immediate offsets when it
is a constant within DXIL's -8..7; a computed or wider offset is still
refused, now saying so. Module::int_value reads an integer constant.

translate --validate on shaders.rpf: vertex/pixel 12172 -> 12176
validated (all four).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:10:48 +00:00
github manually merged commit 260611acaa into gh-pr/634/base 2026-11-26 04:10:48 +00:00
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 07:47 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100.

Both clear the 4 image_sample_o refusals:

  • #634: the 4 programs then validate (VS/PS 12276 / 12176).
  • #360: they emit but all 4 fail the validator with "offset texture instructions must take offset which can resolve to integer literal" (VS/PS 12276 / 12172), so no validated gain.

cargo test -p victory-shader passes on both.

**@⁠slint6614-dev** on GitHub · 2026-11-24 07:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/634#issuecomment-7125373226) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate`, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100. Both clear the 4 `image_sample_o` refusals: - #634: the 4 programs then validate (VS/PS 12276 / 12176). - #360: they emit but all 4 fail the validator with "offset texture instructions must take offset which can resolve to integer literal" (VS/PS 12276 / 12172), so no validated gain. `cargo test -p victory-shader` passes on both.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!634
No description provided.