shader: handle image_sample_c_lz mip filter bits 28-31 in gfx2hlsl (Part of #1723) #2029

Merged
tedin7 merged 2 commits from upstream-pr/2036 into main 2026-11-25 00:47:47 +00:00
tedin7 commented 2026-11-24 23:32:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:32:02Z.


Part of #1723

What this unblocks: Run 20 census #7 (70 pairs), image_sample_c_lz with sampler word 2 bits 28-30 set.

image_sample_c_lz was refused for any comparison sampler with a non-zero word 2 bit in 28-31. The explicit level-zero form does not depend on bits 28-30: MIP_POINT_PRECLAMP only acts on mip selection, ANISO_OVERRIDE only on anisotropic filtering (already refused), and BLEND_ZERO_PRT only on partially resident textures. comparison_sampler_state in tools/pixel_aot.py gets a level_zero flag; the startup translator sets it for c_lz only. Bit 31 (unnamed in the register database) is still refused. The implicit image_sample_c form and the pixel AOT path keep the strict check.

Verification:

  • python3 -B tests/startup_gfx2hlsl_sample_c_lz_mip_check.py on this branch: PASS. It patches the sampler word 2 literal of the existing lz fixture to bit 28, 29, 30 and all three, and checks the SampleCmpLevelZero lowering and the smpc manifest line; bit 31 and the implicit c form must still be refused.
  • The same test with tools/ from origin/main: fails with image_sample_c_lz sampler: Unsupported mip filter or word 2 bits 28-31.
  • tests/startup_image_sample_c_check.py, tests/pixel_compare_check.py and every tests/startup_gfx2hlsl_*check.py, run one by one: all exit 0.
  • Registered as startup_gfx2hlsl_sample_c_lz_mip in CMakeLists.txt. Run on Linux, not on Win2025. No ctest run.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593561119 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2036). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:32:02Z. --- Part of #1723 What this unblocks: Run 20 census #7 (70 pairs), `image_sample_c_lz` with sampler word 2 bits 28-30 set. `image_sample_c_lz` was refused for any comparison sampler with a non-zero word 2 bit in 28-31. The explicit level-zero form does not depend on bits 28-30: MIP_POINT_PRECLAMP only acts on mip selection, ANISO_OVERRIDE only on anisotropic filtering (already refused), and BLEND_ZERO_PRT only on partially resident textures. `comparison_sampler_state` in `tools/pixel_aot.py` gets a `level_zero` flag; the startup translator sets it for `c_lz` only. Bit 31 (unnamed in the register database) is still refused. The implicit `image_sample_c` form and the pixel AOT path keep the strict check. Verification: - `python3 -B tests/startup_gfx2hlsl_sample_c_lz_mip_check.py` on this branch: `PASS`. It patches the sampler word 2 literal of the existing `lz` fixture to bit 28, 29, 30 and all three, and checks the `SampleCmpLevelZero` lowering and the `smpc` manifest line; bit 31 and the implicit `c` form must still be refused. - The same test with `tools/` from `origin/main`: fails with `image_sample_c_lz sampler: Unsupported mip filter or word 2 bits 28-31`. - `tests/startup_image_sample_c_check.py`, `tests/pixel_compare_check.py` and every `tests/startup_gfx2hlsl_*check.py`, run one by one: all exit 0. - Registered as `startup_gfx2hlsl_sample_c_lz_mip` in CMakeLists.txt. Run on Linux, not on Win2025. No ctest run. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 01:01:13 +00:00
chatgpt-codex-connector[bot commented 2026-11-25 01:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:32:15Z.


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-24T23:35:57.394857Z 94454f1 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:R0Y00/Xbox2Windows:comment:7147511890 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2036#issuecomment-7147511890). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:32:15Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"94454f1247492f18cc998f3448c4bafebdc474d9","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-24T23:35:57.394857Z">2026-11-24T23:35:57.394857Z</relative-time> | `94454f1` | 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>
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
R0Y00/Xbox2Windows!2029
No description provided.