nir/tex_instr_create: Initialize all 4 sources
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 8 Jan 2015 01:52:37 +0000 (17:52 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:20:21 +0000 (07:20 -0800)
This helps a lot with things like lowering passes that may need to add
sources.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir.c

index b15440b0855b28adaff6bf775b0ed54b17026411..3a64135d94e46b71b45a02ff59a904186c4fd1fa 100644 (file)
@@ -461,7 +461,7 @@ nir_tex_instr_create(void *mem_ctx, unsigned num_srcs)
    dest_init(&instr->dest);
 
    instr->num_srcs = num_srcs;
-   for (unsigned i = 0; i < num_srcs; i++)
+   for (unsigned i = 0; i < 4; i++)
       src_init(&instr->src[i]);
 
    instr->has_predicate = false;