spirv: reduce array size in vtn_handle_constant
authorKarol Herbst <kherbst@redhat.com>
Wed, 10 Apr 2019 14:46:50 +0000 (16:46 +0200)
committerKarol Herbst <kherbst@redhat.com>
Sun, 14 Apr 2019 20:25:56 +0000 (22:25 +0200)
we already assert above that there are no more than 3 sources, so it
doesn't make sense to use an array of 4 sources

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/spirv_to_nir.c

index 98205a1b8b26e5dbc9ec89c7f1e3055277328ec9..6fae48074f7c1e913b835cc63a58ea32e932cc5b 100644 (file)
@@ -2005,7 +2005,7 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
          nir_op op = vtn_nir_alu_op_for_spirv_opcode(b, opcode, &swap,
                                                      nir_alu_type_get_type_size(src_alu_type),
                                                      nir_alu_type_get_type_size(dst_alu_type));
-         nir_const_value src[4];
+         nir_const_value src[3];
 
          for (unsigned i = 0; i < count - 4; i++) {
             struct vtn_value *src_val =