diff options
author | Jason Ekstrand <[email protected]> | 2015-09-09 13:18:29 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-11 09:21:04 -0700 |
commit | 8c8fc5f8336c8c79e5890265ae6c03271aa94075 (patch) | |
tree | 862f8a0cad00a534a147ccffc70741f71a3428e6 /src/glsl/nir/nir.h | |
parent | 794355e77167291a3acc8d42249c760c24f54f38 (diff) |
nir: Fix a bunch of ralloc parenting errors
As of a10d4937, we would really like things associated with an instruction
to be allocated out of that instruction and not out of the shader. In
particular, you should be passing the instruction that will ultimately be
holding the source into nir_src_copy rather than an arbitrary memory
context.
We also change the prototypes of nir_dest_copy and nir_alu_src/dest_copy to
explicitly take an instruction so we catch this earlier in the future.
Cc: "11.0" <[email protected]>
Reviewed-by: Thomas Helland <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index f9c829570c5..92945f9df7f 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -580,8 +580,8 @@ nir_dest_for_reg(nir_register *reg) return dest; } -void nir_src_copy(nir_src *dest, const nir_src *src, void *mem_ctx); -void nir_dest_copy(nir_dest *dest, const nir_dest *src, void *mem_ctx); +void nir_src_copy(nir_src *dest, const nir_src *src, void *instr_or_if); +void nir_dest_copy(nir_dest *dest, const nir_dest *src, nir_instr *instr); typedef struct { nir_src src; @@ -630,10 +630,6 @@ typedef struct { unsigned write_mask : 4; /* ignored if dest.is_ssa is true */ } nir_alu_dest; -void nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src, void *mem_ctx); -void nir_alu_dest_copy(nir_alu_dest *dest, const nir_alu_dest *src, - void *mem_ctx); - typedef enum { nir_type_invalid = 0, /* Not a valid type */ nir_type_float, @@ -702,6 +698,11 @@ typedef struct nir_alu_instr { nir_alu_src src[]; } nir_alu_instr; +void nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src, + nir_alu_instr *instr); +void nir_alu_dest_copy(nir_alu_dest *dest, const nir_alu_dest *src, + nir_alu_instr *instr); + /* is this source channel used? */ static inline bool nir_alu_instr_channel_used(nir_alu_instr *instr, unsigned src, unsigned channel) |