nir: Add nir_imm_ivec2 helper
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
3966f053a1
commit
c869646b7d
|
@ -254,6 +254,18 @@ nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
|
|||
return nir_build_imm(build, 4, 32, v);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue