diff options
author | Jason Ekstrand <[email protected]> | 2014-12-15 17:32:56 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:20:22 -0800 |
commit | 2c7da78805175f36879111306ac37c12d33bf65b (patch) | |
tree | 5fbfa3578dae242c5fa29cf46c647af351fda881 /src/glsl/nir/nir.h | |
parent | 675ffdef3010400567a5f6f790f1f7bd2fede717 (diff) |
nir: Make load_const SSA-only
As it was, we weren't ever using load_const in a non-SSA way. This allows
us to substantially simplify the load_const instruction. If we ever need a
non-SSA constant load, we can do a load_const and an imov.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index b33d9c84909..8ff4087c240 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -918,22 +918,9 @@ typedef struct { typedef struct { nir_instr instr; - union { - nir_const_value value; - nir_const_value *array; - }; - - unsigned num_components; - - /** - * The number of constant array elements to be copied into the variable. If - * this != 0, then value.array holds the array of size array_elems; - * otherwise, value.value holds the single vector constant (the more common - * case, and the only case for SSA destinations). - */ - unsigned array_elems; + nir_const_value value; - nir_dest dest; + nir_ssa_def def; } nir_load_const_instr; typedef enum { @@ -1280,7 +1267,8 @@ nir_alu_instr *nir_alu_instr_create(void *mem_ctx, nir_op op); nir_jump_instr *nir_jump_instr_create(void *mem_ctx, nir_jump_type type); -nir_load_const_instr *nir_load_const_instr_create(void *mem_ctx); +nir_load_const_instr *nir_load_const_instr_create(void *mem_ctx, + unsigned num_components); nir_intrinsic_instr *nir_intrinsic_instr_create(void *mem_ctx, nir_intrinsic_op op); |