shader: name the refusal of a sampler built from computed words #58

Manually merged
github merged 2 commits from gh-pr/58/head into gh-pr/58/base 2026-11-26 14:44:29 +00:00
Owner

@⁠Sandile-0511 on GitHub · 2026-11-26 11:35 UTC · original
Sandile-0511:fix/name-computed-sampler-refusal → main · +67 −1 · 4 files · 2 commits · merged 2026-11-26 11:55 UTC

What this changes

a computed buffer descriptor used as a view can never come from a buffer access. classify labels any untraceable four-dword group with a constant last dword as BuiltMemory when computed_buffers is on, whatever operand it is, so the message is only reached from an image instruction: through its sampler, or through a 128-bit image descriptor. The reported offset is the consumer's, because the failing instruction has no side effect.

This gives the sampler case its own message, a sampler built from computed words, and documents both cases. No lowering changes. In a run at world load the new message appeared, so at least one real shader has the sampler shape.

Supporting it needs more than the translator (a static sampler cannot carry runtime state); I can write that up separately.

How it was tested

  • cargo test -p victory-shader: 220 passed, 0 failed, 2 ignored. New test guessed_pixel_computed_samplers_and_short_images_remain_refused (computed sampler gives the new message at the export's offset; the same sampler with constant dwords lowers; an r128 image keeps the old message).
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings (clean, run on a Mac)
  • cargo xtask policy (365 files ok)
  • Ran the game in a combined local build: "a sampler built from computed words" is logged in place of the old message.

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none made)
  • New diagnostics are behind a VICTORY_* variable and documented (none added)
**@⁠Sandile-0511** on GitHub · 2026-11-26 11:35 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/58) `Sandile-0511:fix/name-computed-sampler-refusal` → `main` · +67 −1 · 4 files · 2 commits · merged 2026-11-26 11:55 UTC ## What this changes `a computed buffer descriptor used as a view` can never come from a buffer access. `classify` labels any untraceable four-dword group with a constant last dword as `BuiltMemory` when `computed_buffers` is on, whatever operand it is, so the message is only reached from an image instruction: through its sampler, or through a 128-bit image descriptor. The reported offset is the consumer's, because the failing instruction has no side effect. This gives the sampler case its own message, `a sampler built from computed words`, and documents both cases. No lowering changes. In a run at world load the new message appeared, so at least one real shader has the sampler shape. Supporting it needs more than the translator (a static sampler cannot carry runtime state); I can write that up separately. ## How it was tested - [x] `cargo test -p victory-shader`: 220 passed, 0 failed, 2 ignored. New test `guessed_pixel_computed_samplers_and_short_images_remain_refused` (computed sampler gives the new message at the export's offset; the same sampler with constant dwords lowers; an `r128` image keeps the old message). - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` (clean, run on a Mac) - [x] `cargo xtask policy` (365 files ok) - [x] Ran the game in a combined local build: "a sampler built from computed words" is logged in place of the old message. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none made) - [x] New diagnostics are behind a `VICTORY_*` variable and documented (none added)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:44:27 +00:00
github manually merged commit 22d605a0b8 into gh-pr/58/base 2026-11-26 14:44:29 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 11:51 UTC · original · approved these changes

The targeted refusal looks good. The regression checks the new sampler message, the unchanged short-image message, and the constant sampler case. One wording nit for follow-up: the BuiltMemory fallback also requires computed buffers to be enabled and the inferred address to resolve to MEMORY.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 11:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/58#pullrequestreview-6073658445) · **approved these changes** The targeted refusal looks good. The regression checks the new sampler message, the unchanged short-image message, and the constant sampler case. One wording nit for follow-up: the `BuiltMemory` fallback also requires computed buffers to be enabled and the inferred address to resolve to `MEMORY`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.