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

Manually merged
github merged 2 commits from gh-pr/2036/head into gh-pr/2036/base 2026-11-26 23:51:17 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 23:32 UTC · original
tedin7:x2w-r20-sample-c-lz → main · +83 −3 · 5 files · 2 commits · merged 2026-11-25 00:47 UTC

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.

**@⁠tedin7** on GitHub · 2026-11-24 23:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2036) `tedin7:x2w-r20-sample-c-lz` → `main` · +83 −3 · 5 files · 2 commits · merged 2026-11-25 00:47 UTC 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.
Part of #1723. Bits 28-30 do not change an explicit level-zero comparison; bit 31 and implicit image_sample_c still refuse.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:51:16 +00:00
github manually merged commit 7c2838dc6a into gh-pr/2036/base 2026-11-26 23:51:17 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:32 UTC · original · edited 2026-11-24 23:35 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-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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 23:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2036#issuecomment-7147511890) · edited 2026-11-24 23:35 UTC <!-- 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>
This discussion has been locked. Commenting is limited to contributors.
No description provided.