From 18115a5df56e6e364fbf53104684976db4bfa29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Wed, 1 Apr 2026 17:36:27 +0200 Subject: [PATCH] gallium/u_blitter: remove unused CONST declaration when using IMM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 2ff9fa8b728c ("gallium/u_blitter: add a new fs_color_clear variant") Reviewed-by: Marek Olšák (cherry picked from commit 79e3196320616ea3567a8465d283665a547030ba) Part-of: --- .pick_status.json | 2 +- src/gallium/auxiliary/util/u_simple_shaders.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c76e6ed16c1..f667b4062f6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1694,7 +1694,7 @@ "description": "gallium/u_blitter: remove unused CONST declaration when using IMM", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2ff9fa8b728c5f206e19433a9d9b88eb8d97055b", "notes": null diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index dac7c1da510..48c234c1436 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -1321,7 +1321,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" @@ -1330,6 +1330,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];