diff options
author | Jason Ekstrand <[email protected]> | 2018-03-19 13:43:35 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-04-05 13:20:39 -0700 |
commit | e85b95269e49036402c3a8204450707eb6111d15 (patch) | |
tree | 9406d684bcdf3c115f33d677ebc585057437adda /src/compiler/nir | |
parent | c7dd59b06d93e6820189e2d1e087c0811707ee07 (diff) |
prog/nir: Simplify some load/store operations
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 8f7ddf1483c..d699b5ee1bf 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -526,6 +526,12 @@ nir_ssa_for_alu_src(nir_builder *build, nir_alu_instr *instr, unsigned srcn) } static inline nir_ssa_def * +nir_load_reg(nir_builder *build, nir_register *reg) +{ + return nir_ssa_for_src(build, nir_src_for_reg(reg), reg->num_components); +} + +static inline nir_ssa_def * nir_load_var(nir_builder *build, nir_variable *var) { const unsigned num_components = glsl_get_vector_elements(var->type); |