AGC: hardware behaviour of anisotropic filtering with unnormalized S# coordinates (measured) #27644
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-26T21:12:48Z.
GuestSamplerResource.cpprefuses an S# withFORCE_UNNORMALIZEDand an anisotropic XY filter ("guest sampler descriptor uses unnormalized coordinates with anisotropic filtering, which is not implemented"). In my runs it stops PPSA02630 (Destruction AllStars), PPSA22102 and PPSA05213. Vulkan forbids anisotropy withunnormalizedCoordinates, so a fix has to reproduce the hardware behaviour. Here is a measurement of that behaviour, so nobody maps it to plain linear filtering.Probe:
tools/hw-oracleon an RX 6650 XT (gfx1032, Linux, HSA), main97319cf0b9.32_FLOATimage with texels 0, 10, 20, 30 and identity selects. It's one row high, so pitch doesn't matter.FORCE_UNNORMALIZED, clamp to last texel, max aniso ratio 4×, MIN = MAG filter.image_samplewith dmask 0xf at y = 0.5 and these unnormalized x values in six lanes: 0.5, 1.0, 1.5, 2.0, 2.25, 3.5. Implicit derivatives come from the quads: x steps of 0.5 in the first quad, then 1.25.All four components were equal in every case.
What this shows: the hardware does not ignore the anisotropic filter with unnormalized coordinates. Aniso point already behaves like linear inside the image. Near the clamped edges both aniso modes differ from linear: 0.625 instead of 0 at x = 0.5, and 27.5 / 26.77 instead of 30 at x = 3.5. That fits a multi-tap footprint driven by the derivatives. Treating these samplers as linear would therefore be wrong at edges and wherever derivatives are large. A correct implementation needs the anisotropic taps emulated in the shader, so the refusal is right until that exists.
Not measured: other ratios, filter combinations with a mip filter, 2D footprints, and wave64.
AI-assisted: yes