textures: accept logical dimensions for late BC7 tails #245
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/248"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:13:20Z.
Change
Add an optional
--base-size WIDTH HEIGHTto the BC7 tail draw. This lets the caller supply the logical resource size when a late mip has already clamped to one texel on an axis. The terminal 1×1 case can represent either a 4096×4 texture or a 4×4096 texture. Both now work with their respective explicit dimensions. Existing commands retain the original size inference. Addresses the late-tail finding on #204.The declared size determines the resource allocation and each fallback render target. The check rejects an absent mip or first-resident dimensions inconsistent with the declared texture. Point-sampled references use the visible pixel center, including when the source and target dimensions have a non-integer ratio.
Verification
Tested commits
4843327andfb43669on merged upstream base64e8d0e, Windows 11 x64 build 26200, Python 3.12.10:Before the change, the 2×1 and 1×1 cases from a 4096×4 chain at first resident level 11, or its 1×1 case alone at level 12, both failed with
Logical BC7 texture exceeds fixture bounds. The new WARP regression failed on the old CLI. On the rebased change all four focused CTests and the direct WARP test passed. With explicit dimensions, both WARP 10.0.26100.9818 and the RTX 5080 on driver 32.0.16.1692 matched the 16,384-pixel fallback and every resident draw. Both also passed the transposed orientation and a 116×76 texture beginning at mip 3. In the 29×19 fallback, WARP and hardware selected opposite neighbors at the exact source texel boundary at (14, 0). Both accepted their own complete texel and rejected a control shader mixing red/blue from the left neighbor with green/alpha from the right at just that pixel. Debug layers were unavailable; neither backend skipped.At 92×4 with first resident mip 5, the original viewport failed the terminal 1×1 readback on WARP. Scaling only from the 2×1 resident extent failed the preceding 2×1 readback on RTX 5080. Commit
fb43669centers the viewport span between both derivative estimates in log space. The unchanged translated shader uses implicitTexture2D.Sample. Both adapters matched each magnified fallback and both native levels for 92×4 and 4×92. All four focused CTests and the direct WARP check passed. Review measurements.Evidence and follow-up
The MIT-licensed fixture builds each mip from a repeated mode-6 BC7 block and independently generated reference colors. Distinct endpoints and per-texel indices distinguish level selection and sample position. Negative controls require rejection of mip 12 for a 4×4 base and of a 1×2 first level for a 4096×4 texture at mip 11. The test supplies the base dimensions explicitly. This experiment uses source-built textures and makes no claim about any installation.
AI-assisted contribution.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:21:53Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
484332760fℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:26:16Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T19:16:09Z.
Independent run at
4843327(on64e8d0e) on an AMD GPU, to add RDNA 4 next to the RTX 5080 and WARP results.Environment: Windows 11 build 26200, MSVC 19.50.35720, Windows SDK 10.0.26100.0, DXC 1.8.2502.11, D3D12 debug layer enabled.
Every resident and fallback draw in
bc7_draw_hardwarereportedmax_absolute_error=0anddebug_errors=0 debug_warnings=0. That run includes:--base-size4096×4 and 4×4096 late tails at first resident levels 11 and 12;Not measured: which neighbour the RX 9070 XT picks at the exact tie at (14, 0). The check accepts either complete texel and does not print the choice.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:28:36Z.
@codex review
Please recheck the implicit mip selection finding against
fb43669. The regression now covers both resident levels of 92×4 and 4×92 on WARP and RTX 5080. Before-and-after readbacks.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:32:19Z.
Codex Review: Didn't find any major issues. 👍
Reviewed commit:
fb436695d2ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:13:28Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
fb43669ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:21:53Z.
Code review location:
tests/pixel_aot_render.cpp; line 193For a tail starting at mip 5 with
--base-size 92 4and valid2×1and1×1cases, the SRV begins at a rounded2×1mip, but the terminal draw now uses a1.4375×1viewport. Implicit LOD is based on the SRV's first visible extent, so the point mip filter getslog2(2 / 1.4375) ≈ 0.476and selects resident level 0 instead of level 1. The verifier consequently compares the wrong mip against the1×1reference and rejects a correct copy shader. Keep the declared base for resource and target dimensions, but derive the derivative-preserving viewport from the first resident extent and the relative sampled level.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:26:16Z.
Code review location:
tests/pixel_aot_render.cpp; line 193Confirmed on WARP with the source-built 92×4 texture at first resident mip 5. On
4843327, mip 5 matched, then mip 6 returned red 0.113708 at (0, 0) against the 1×1 reference value 0.0313721. The same draw passed on RTX 5080. I also tried the resident-only viewport. That passed on WARP, but RTX then selected mip 6 during the mip 5 draw, returning 0.0313721 against 0.0627441.fb43669centers the viewport span midway in log space between the rounded first-resident extent and the unrounded base-derived extent. The translated copy shader still uses implicitTexture2D.Sample. On both WARP and RTX 5080, each of the five magnified fallbacks and both native draws now matched every RGBA channel for 92×4 and 4×92. The regression checks both orientations with distinct adjacent mip colors. The existing mixed-texel negative control and all four BC7/pixel WARP/hardware CTests also passed locally.