From c869646b7dae59d5f5d0bb718029713a85f95c6f Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Wed, 10 Oct 2018 17:14:34 -0700 Subject: [PATCH] nir: Add nir_imm_ivec2 helper Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_builder.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) { -- 2.30.2