mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
nir: Allocate nir_ssa_def::uses/if_uses out of the instruction.
We can't allocate them out of the nir_ssa_def itself, because it may not be ralloc'd (for example, nir_dest embeds a nir_ssa_def). However, allocating them out of the instruction should work. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
900498bd11
commit
4f4b04b7c7
1 changed files with 2 additions and 4 deletions
|
|
@ -1834,13 +1834,11 @@ void
|
|||
nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def,
|
||||
unsigned num_components, const char *name)
|
||||
{
|
||||
void *mem_ctx = ralloc_parent(instr);
|
||||
|
||||
def->name = name;
|
||||
def->parent_instr = instr;
|
||||
def->uses = _mesa_set_create(mem_ctx, _mesa_hash_pointer,
|
||||
def->uses = _mesa_set_create(instr, _mesa_hash_pointer,
|
||||
_mesa_key_pointer_equal);
|
||||
def->if_uses = _mesa_set_create(mem_ctx, _mesa_hash_pointer,
|
||||
def->if_uses = _mesa_set_create(instr, _mesa_hash_pointer,
|
||||
_mesa_key_pointer_equal);
|
||||
def->num_components = num_components;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue