nir: add imm_vec3 to round these out

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12253>
This commit is contained in:
Mike Blumenkrantz 2021-08-06 14:47:37 -04:00 committed by Marge Bot
parent 02b6015945
commit ec66c58138

View file

@ -352,6 +352,17 @@ nir_imm_vec2(nir_builder *build, float x, float y)
return nir_build_imm(build, 2, 32, v);
}
static inline nir_ssa_def *
nir_imm_vec3(nir_builder *build, float x, float y, float z)
{
nir_const_value v[3] = {
nir_const_value_for_float(x, 32),
nir_const_value_for_float(y, 32),
nir_const_value_for_float(z, 32),
};
return nir_build_imm(build, 3, 32, v);
}
static inline nir_ssa_def *
nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
{