glsl: Silence a warning at -Og
../src/compiler/glsl/gl_nir_link_uniforms.c: In function ‘gl_nir_link_uniforms’: ../src/compiler/glsl/gl_nir_link_uniforms.c:1747:39: warning: ‘num_blocks’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1747 | for (unsigned i = 0; i < num_blocks; i++) { Don't have the patience to seee how you'd hit this but doing nothing is clearly the right edge case behavior. Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>
This commit is contained in:
@@ -1652,7 +1652,7 @@ gl_nir_link_uniforms(struct gl_context *ctx,
|
||||
int location = var->data.location;
|
||||
|
||||
struct gl_uniform_block *blocks;
|
||||
int num_blocks;
|
||||
int num_blocks = 0;
|
||||
int buffer_block_index = -1;
|
||||
if (!prog->data->spirv && state.var_is_in_block) {
|
||||
/* If the uniform is inside a uniform block determine its block index by
|
||||
|
Reference in New Issue
Block a user