Recompiler: preserve the texture footprint for cubemap samples with explicit gradients #762

Open
opened 2026-11-24 04:52:41 +00:00 by AkshatPal2007 · 0 comments
AkshatPal2007 commented 2026-11-24 04:52:41 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by AkshatPal2007 on 2026-11-24T04:52:41Z.


The MIMG cube path in emit.rs reduces two face-space gradients to one LOD and calls SampleLevel. An anisotropic sampler loses the direction of the footprint. HANDOFF.md records image_sample_d(_cl) on cubemaps in a retail shader survey.

On 64b3f35, a synthetic IMAGE_SAMPLE_D kernel sampled a white column on a 32×32 face with an 8×1 texel footprint and a 16× anisotropic sampler. The cube returned 1.0, while the equivalent 2D-array slice returned 0.125 on the same RTX 4070 Laptop GPU (Windows 11, DXC 1.8.2502). Both views had one mip.

I’m working on projecting the two gradients into direction space for native TextureCubeArray.SampleGrad, including minimum LOD, and comparing both sampling paths in a GPU test. Retail visual impact has not been measured.

AI use: Codex (gpt-6.2-astra) investigated the emitter, wrote and ran the synthetic reproduction, and drafted this issue.

<!-- greyfinch-sync:ivall/xcl:issue:6574888942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/767). Originally posted by [AkshatPal2007](https://github.com/AkshatPal2007) on 2026-11-24T04:52:41Z. --- The MIMG cube path in `emit.rs` reduces two face-space gradients to one LOD and calls `SampleLevel`. An anisotropic sampler loses the direction of the footprint. `HANDOFF.md` records `image_sample_d(_cl)` on cubemaps in a retail shader survey. On `64b3f35`, a synthetic `IMAGE_SAMPLE_D` kernel sampled a white column on a 32×32 face with an 8×1 texel footprint and a 16× anisotropic sampler. The cube returned **1.0**, while the equivalent 2D-array slice returned **0.125** on the same RTX 4070 Laptop GPU (Windows 11, DXC 1.8.2502). Both views had one mip. I’m working on projecting the two gradients into direction space for native `TextureCubeArray.SampleGrad`, including minimum LOD, and comparing both sampling paths in a GPU test. Retail visual impact has not been measured. AI use: Codex (gpt-6.2-astra) investigated the emitter, wrote and ran the synthetic reproduction, and drafted this issue.
Sign in to join this conversation.
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
xcl-dev/xcl#762
No description provided.