mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
AMD hardware compares a sample_c reference against a color texture's red channel; Vulkan defines comparison sampling only for depth formats, so the driver refused any compare-sampled texture that is not R32 float or R16 unorm. PPSA21567 compares the same LESSEQUAL, clamp-to-border (opaque white) sampler against a shadow map and against a 1x1 RGBA8 texture. For a compare-sampled image whose format is not natively comparable, the specialization records the paired sampler's compare function, filter, addressing and border, and the view's reference clamp kind; the image then binds as an ordinary color texture. The backend fetches the red channel, applies wrap, clamp-to-edge or clamp-to-border addressing with the sampler's texel-centre convention (border taps take the border's red), compares, and blends four comparisons for bilinear filtering. Real depth formats keep the native path. Only sample_c / sample_c_lz on 2D and 2D array views, float/unorm/snorm formats, wrap, clamp-to-edge or clamp-to-border, point or bilinear at one level are implemented; half-border, the border color table and everything else on this path throw. The reference clamp for unorm/snorm color formats is not documented by AMD and is recorded in the technical debt. Co-Authored-By: Claude Opus 5.5 <[email protected]>