diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-10-10 17:14:34 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-10-15 17:29:46 -0700 |
commit | c869646b7dae59d5f5d0bb718029713a85f95c6f (patch) | |
tree | d006a53e1d78c066677396d54f1306a2a9459869 | |
parent | 3966f053a14c5f1c57738143fea3d239070e5517 (diff) |
nir: Add nir_imm_ivec2 helper
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_builder.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 8c883f27619..398fa68c251 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -255,6 +255,18 @@ nir_imm_vec4(nir_builder *build, float x, float y, float z, float w) } static inline nir_ssa_def * +nir_imm_ivec2(nir_builder *build, int x, int y) +{ + nir_const_value v; + + memset(&v, 0, sizeof(v)); + v.i32[0] = x; + v.i32[1] = y; + + return nir_build_imm(build, 2, 32, v); +} + +static inline nir_ssa_def * nir_imm_int(nir_builder *build, int x) { nir_const_value v; |