gallium/u_blitter: remove unused CONST declaration when using IMM

The immediate fs_clear_color shader uses IMM[0] but still declares
CONST[0][0]. That can make drivers try to read a fragment constant
buffer even though one is never uploaded on this path. Only declare
CONST[0][0] when the shader actually uses a constant buffer.

Fixes: 2ff9fa8b72 ("gallium/u_blitter: add a new fs_color_clear variant")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40760>
This commit is contained in:
Pavel Ondračka 2026-04-01 17:36:27 +02:00 committed by Marge Bot
parent 33ab9087c8
commit 79e3196320

View file

@ -1337,7 +1337,7 @@ util_make_fs_clear_color(struct pipe_context *pipe,
"FRAG\n"
"PROPERTY FS_COLOR0_WRITES_ALL_CBUFS %u\n"
"DCL OUT[0], COLOR[0]\n"
"DCL CONST[0][0]\n"
"%s"
"IMM[0] INT32 {0, 0, 0, 0}\n"
"MOV OUT[0], %s\n"
@ -1346,6 +1346,7 @@ util_make_fs_clear_color(struct pipe_context *pipe,
snprintf(text, ARRAY_SIZE(text), text_templ,
write_all_cbufs,
use_const_buf ? "DCL CONST[0][0]\n" : "",
use_const_buf ? "CONST[0][0]" : "IMM[0]");
struct tgsi_token tokens[1000];