mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 18:50:10 +01:00
nir: Allocate nir_tex_instr::sources out of the instruction itself.
The lifetime of the sources array needs to be match the nir_tex_instr itself. So, allocate it using the instruction itself as the context. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
7380c641b1
commit
da5ec2ac0b
1 changed files with 1 additions and 1 deletions
|
|
@ -460,7 +460,7 @@ nir_tex_instr_create(void *mem_ctx, unsigned num_srcs)
|
|||
dest_init(&instr->dest);
|
||||
|
||||
instr->num_srcs = num_srcs;
|
||||
instr->src = ralloc_array(mem_ctx, nir_tex_src, num_srcs);
|
||||
instr->src = ralloc_array(instr, nir_tex_src, num_srcs);
|
||||
for (unsigned i = 0; i < num_srcs; i++)
|
||||
src_init(&instr->src[i].src);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue