nir/builder: Move nir_imm_vec2 from blorp into the builder
While we're here, fix a typo which caused it to actually return a vec4 with the third and fourth components zero. Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -279,6 +279,18 @@ nir_imm_floatN_t(nir_builder *build, double x, unsigned bit_size)
|
||||
unreachable("unknown float immediate bit size");
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
nir_imm_vec2(nir_builder *build, float x, float y)
|
||||
{
|
||||
nir_const_value v;
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
v.f32[0] = x;
|
||||
v.f32[1] = y;
|
||||
|
||||
return nir_build_imm(build, 2, 32, v);
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
|
||||
{
|
||||
|
Reference in New Issue
Block a user