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

Closed
JordanFableFur wants to merge 1 commit from upstream-pr/386 into main
JordanFableFur commented 2026-11-25 00:14:25 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T00:14:25Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6594126568 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/386). Originally posted by [JordanFableFur](https://github.com/JordanFableFur) on 2026-11-25T00:14:25Z. --- ## 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.
chatgpt-codex-connector[bot commented 2026-11-25 01:11:57 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:14:36Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7148302620 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7148302620). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:14:36Z. --- <!-- 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>
kaayzouee commented 2026-11-25 01:12:07 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:03:31Z.


Duplicate of #276?

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149162559 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7149162559). Originally posted by [kaayzouee](https://github.com/kaayzouee) on 2026-11-25T01:03:31Z. --- Duplicate of #276?
upstream-sync closed this pull request 2026-11-25 02:09:29 +00:00
JordanFableFur commented 2026-11-25 02:10:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T01:46:25Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149939415 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/386#issuecomment-7149939415). Originally posted by [JordanFableFur](https://github.com/JordanFableFur) on 2026-11-25T01:46:25Z. --- Closing — #276 fixes the same issue (#250) and was opened first, with a dxil.dll-validated test. Thanks for flagging.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!386
No description provided.