From fc2b32c5d3a92dc3a805d0a55989250ab7639774 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 20 Jul 2023 18:02:08 +0200 Subject: [PATCH] gallium/auxiliary/vl: Handle UV subsampling in compute_shader_yuv Also remove the 1px vertical shift as it results in a black line at the bottom of the picture. Reviewed-by: Thong Thai Part-of: --- src/gallium/auxiliary/vl/vl_compositor_cs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c index 0685073b518..17587a79db4 100644 --- a/src/gallium/auxiliary/vl/vl_compositor_cs.c +++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c @@ -628,7 +628,6 @@ static const char *compute_shader_yuv_y = "MOV TEMP[4].xy, CONST[6].zwww\n" "I2F TEMP[4], TEMP[4]\n" "ADD TEMP[2], TEMP[2], TEMP[4]\n" - "ADD TEMP[2].y, TEMP[2].yyyy, IMM[1].xxxx\n" /* Fetch texels */ "TEX_LZ TEMP[4].x, TEMP[2], SAMP[0], RECT\n" @@ -674,6 +673,7 @@ static const char *compute_shader_yuv_uv = /* Translate */ "UADD TEMP[2].xy, TEMP[2], -CONST[5].xyxy\n" "U2F TEMP[2], TEMP[2]\n" + "MUL TEMP[2].xy, TEMP[2].xyyy, CONST[6].xyyy\n" /* Scale */ "DIV TEMP[2], TEMP[2], CONST[3].zwzw\n" @@ -682,7 +682,6 @@ static const char *compute_shader_yuv_uv = "MOV TEMP[4].xy, CONST[6].zwww\n" "I2F TEMP[4], TEMP[4]\n" "ADD TEMP[2], TEMP[2], TEMP[4]\n" - "ADD TEMP[2].y, TEMP[2].yyyy, IMM[1].xxxx\n" /* Fetch texels */ "TEX_LZ TEMP[4].y, TEMP[2], SAMP[1], RECT\n"