zink: Remove duplicate variable unsized.
authorVinson Lee <vlee@freedesktop.org>
Sat, 30 Oct 2021 21:17:10 +0000 (14:17 -0700)
committerVinson Lee <vlee@freedesktop.org>
Tue, 2 Nov 2021 01:59:45 +0000 (18:59 -0700)
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In unsized = unsized =
glsl_array_type(glsl_uintN_t_type(bit_size), 0U, bit_size / 8U),
unsized is written twice with the same value.

Fixes: f79a25653b9 ("zink: move all shader bo/sharedmem access to compiler passes")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13607>

src/gallium/drivers/zink/zink_compiler.c

index 6a22716..076c44c 100644 (file)
@@ -751,7 +751,7 @@ get_bo_var(nir_shader *shader, struct bo_vars *bo, bool ssbo, unsigned idx, unsi
       fields[1].name = ralloc_strdup(shader, "unsized");
       const struct glsl_type *array_type = glsl_get_struct_field(var->type, 0);
       const struct glsl_type *type;
-      const struct glsl_type *unsized = unsized = glsl_array_type(glsl_uintN_t_type(bit_size), 0, bit_size / 8);
+      const struct glsl_type *unsized = glsl_array_type(glsl_uintN_t_type(bit_size), 0, bit_size / 8);
       if (bit_size > 32) {
          assert(bit_size == 64);
          type = glsl_array_type(glsl_uintN_t_type(bit_size), glsl_get_length(array_type) / 2, bit_size / 8);