From 9edbab562e5f73c2aff3c2616c3e6f818601d457 Mon Sep 17 00:00:00 2001 From: Charlotte Pabst Date: Fri, 13 Jun 2025 23:09:55 +0200 Subject: [PATCH] mesa: clear program info when updating program string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The program info contains all sorts of flags concerning the compilation state of the program, and those need to be reset when the program is going to be recompiled when its source changes. For example, before this change, after info.flrp_lowered got set following the first call to glProgramStringARB, flrp lowering would not happen for any subsequent updates to the program string, leading to compilation failures. Signed-off-by: Charlotte Pabst Reviewed-by: Marek Olšák Part-of: (cherry picked from commit be6b49449cfde7cad1971bd25ed63ade60bebef3) --- .pick_status.json | 2 +- src/mesa/main/arbprogram.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index a9e2317ea49..2b6510e178b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -8094,7 +8094,7 @@ "description": "mesa: clear program info when updating program string", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 18de59b3ec6..4dec01c8282 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -379,6 +379,14 @@ set_program_string(struct gl_program *prog, GLenum target, GLenum format, GLsize return; } + /* clear info */ + shader_info new_info = { 0 }; + new_info.name = prog->info.name; + new_info.label = prog->info.label; + new_info.stage = prog->info.stage; + new_info.use_legacy_math_rules = prog->info.use_legacy_math_rules; + prog->info = new_info; + #ifdef ENABLE_SHADER_CACHE GLcharARB *replacement;