From: Caio Marcelo de Oliveira Filho Date: Thu, 11 Oct 2018 00:14:34 +0000 (-0700) Subject: nir: Add nir_imm_ivec2 helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c869646b7dae59d5f5d0bb718029713a85f95c6f;p=mesa.git nir: Add nir_imm_ivec2 helper Reviewed-by: Jason Ekstrand --- 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 @@ -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) {