Shaders: a sampler used with and without comparison gets two slots #386

Closed
github-bot wants to merge 1 commit from gh-pr/386/head into gh-pr/386/base
Owner

@⁠JordanFableFur on GitHub · 2026-11-25 00:14 UTC · original
JordanFableFur:fix/static-sampler-cmp-slots → main · +24 −21 · 6 files · 1 commits · closed without merging

What

Static sampler slots were deduplicated by the four sampler words alone. The same words used for an ordinary sample and a comparison sample shared a slot, and the comparison use marked the slot as a comparison one: in comparison-first order the ordinary sample got a comparison handle, in ordinary-first order the earlier ordinary handle and the slot metadata finally disagreed. The DXIL validator requires the sampler kind to match the operation.

A slot is now chosen by the words and whether the use compares, so the two ways get their own slots, and a slot's kind is fixed at its first use instead of folded into the cmp_samplers bitfield afterwards. The kind travels in the slot list (Lowered.samplers holds (words, is_comparison)), and HostShader::samplers keeps its words-only shape for the host.

Fixes #250.

Testing

Clippy -D warnings for both builds and the host-runnable victory-shader tests (170) pass; the emission paths with samplers (the diff/VALU tests) are Windows+GPU-gated and covered by CI: https://github.com/JordanFableFur/victory-fork/actions/runs/45516463576

AI use: written with Codex and Claude Code (GPT-5.2 Codex); reviewed and posted with my approval. No game files were used.

**@⁠JordanFableFur** on GitHub · 2026-11-25 00:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/386) `JordanFableFur:fix/static-sampler-cmp-slots` → `main` · +24 −21 · 6 files · 1 commits · closed without merging ## What Static sampler slots were deduplicated by the four sampler words alone. The same words used for an ordinary sample and a comparison sample shared a slot, and the comparison use marked the slot as a comparison one: in comparison-first order the ordinary sample got a comparison handle, in ordinary-first order the earlier ordinary handle and the slot metadata finally disagreed. The DXIL validator requires the sampler kind to match the operation. A slot is now chosen by the words and whether the use compares, so the two ways get their own slots, and a slot's kind is fixed at its first use instead of folded into the `cmp_samplers` bitfield afterwards. The kind travels in the slot list (`Lowered.samplers` holds `(words, is_comparison)`), and `HostShader::samplers` keeps its words-only shape for the host. Fixes #250. ## Testing Clippy `-D warnings` for both builds and the host-runnable `victory-shader` tests (170) pass; the emission paths with samplers (the diff/VALU tests) are Windows+GPU-gated and covered by CI: https://github.com/JordanFableFur/victory-fork/actions/runs/45516463576 **AI use:** written with Codex and Claude Code (GPT-5.2 Codex); reviewed and posted with my approval. No game files were used.
Static sampler slots were deduplicated by the four sampler words alone.
The same words used for an ordinary sample and a comparison sample
shared a slot, and the comparison use marked it as a comparison one:
the ordinary sample then got a comparison handle (or, met in the other
order, a handle and slot metadata that disagreed). The DXIL validator
requires the sampler kind to match the operation.

A slot is now chosen by the words and whether the use compares, so the
two ways get their own slots, and the slot's kind is fixed at its first
use instead of folded into a bitfield later. The comparison bit moves
from the Lowered bitfield into the slot list (its kind travels with it).

AI use: written with Codex and Claude Code (GPT-5.2 Codex); reviewed and
posted with my approval. No game files were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:15 +00:00
github-bot closed this pull request 2026-11-26 03:42:15 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:14 UTC · original · edited 2026-11-25 00:16 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T00:16:49.232115Z 6390a18 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 00:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7148302620) · edited 2026-11-25 00:16 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6390a18bce944adef78c99b4fab07c67fb551b14","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T00:16:49.232115Z">2026-11-25T00:16:49.232115Z</relative-time> | `6390a18` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠kaayzouee on GitHub · 2026-11-25 01:03 UTC · original

Duplicate of #276?

**@⁠kaayzouee** on GitHub · 2026-11-25 01:03 UTC · [original](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7149162559) Duplicate of #276?
Author
Owner

@⁠JordanFableFur on GitHub · 2026-11-25 01:46 UTC · original

Closing — #276 fixes the same issue (#250) and was opened first, with a dxil.dll-validated test. Thanks for flagging.

**@⁠JordanFableFur** on GitHub · 2026-11-25 01:46 UTC · [original](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7149939415) Closing — #276 fixes the same issue (#250) and was opened first, with a dxil.dll-validated test. Thanks for flagging.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.