From daeb00df144f5ba277862fc8860a06982d30f40c Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 22 Mar 2026 19:53:41 +0800 Subject: [PATCH] glsl: initialize PSIZ variable to NULL when adding pointsize The gl_nir_add_point_size() function now handles either shaders with io_lowered set (no output variable will be created and store_output intrinsic will be used) or with io_lowered cleared (an output variable will be created for PSIZ). However the nir_variable pointer for PSIZ variable is currently not initialized at all, and a -Wmaybe-uninitialized warning may appear complaining this. As it shouldn't be used when it's allocated within the io_lowered cleared situation, initialize it to NULL to satisfy the compiler. Acked-by: Simon Perretta Signed-off-by: Icenowy Zheng Part-of: --- src/compiler/glsl/gl_nir_linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index 10f9b8ee8e7..9280a1f3186 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -1192,7 +1192,7 @@ remove_dead_varyings_pre_linking(nir_shader *nir) bool gl_nir_add_point_size(nir_shader *nir) { - nir_variable *psiz; + nir_variable *psiz = NULL; if (!nir->info.io_lowered) { psiz = nir_create_variable_with_location(nir, nir_var_shader_out, VARYING_SLOT_PSIZ, glsl_float_type());