Clamp chroma texcoords to avoid sampling alignment padding

This resolves #885 without the massive perf hit on lower end Intel GPUs.
This commit is contained in:
Cameron Gutman
2024-06-22 16:19:26 -05:00
parent c3bd7edc4e
commit 94943d2865
7 changed files with 43 additions and 4 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
min16float4 main(ShaderInput input) : SV_TARGET
{
// Clamp the chrominance texcoords to avoid sampling the row of texels adjacent to the alignment padding
min16float3 yuv = min16float3(luminancePlane.Sample(theSampler, input.tex),
chrominancePlane.Sample(theSampler, input.tex));
chrominancePlane.Sample(theSampler, min(input.tex, chromaTexMax.rg)));
// Subtract the YUV offset for limited vs full range
yuv -= offsets;