diff options
author | Jason Ekstrand <[email protected]> | 2015-01-09 20:01:13 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:20:24 -0800 |
commit | 4aa6162f6ecf96c7400c17c310eba0cfd0f5e083 (patch) | |
tree | bf3038964219161441349f7881224dc733a937fe /src/glsl/nir/nir.c | |
parent | dcb1acdea00a8f2c29777ff4078832df9d5b40ce (diff) |
nir/tex_instr: Add a nir_tex_src struct and dynamically allocate the src array
This solves a number of problems. First is the ability to change the
number of sources that a texture instruction has. Second, it solves the
delema that may occur if a texture instruction has more than 4 sources.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r-- | src/glsl/nir/nir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index ad86a6ea945..da9b7a1d3b6 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -447,8 +447,9 @@ nir_tex_instr_create(void *mem_ctx, unsigned num_srcs) dest_init(&instr->dest); instr->num_srcs = num_srcs; - for (unsigned i = 0; i < 4; i++) - src_init(&instr->src[i]); + instr->src = ralloc_array(mem_ctx, nir_tex_src, num_srcs); + for (unsigned i = 0; i < num_srcs; i++) + src_init(&instr->src[i].src); instr->sampler_index = 0; instr->sampler_array_size = 0; |