From be6b49449cfde7cad1971bd25ed63ade60bebef3 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: --- src/mesa/main/arbprogram.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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;