summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_builder.h
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <[email protected]>2016-03-23 10:43:03 +0100
committerSamuel Iglesias Gonsálvez <[email protected]>2016-04-28 11:58:13 +0200
commit3a150683ce2f1245fc6f5a02f4a1c2197353962c (patch)
treee0b085887b32d61df5a1ebec86670fefe58648ab /src/compiler/nir/nir_builder.h
parent76b8c5cc602eda19c91b842b02f84564c18e79a6 (diff)
nir/builder: Add bit_size info to nir_build_imm()
v2: - Group num_components and bit_size together (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_builder.h')
-rw-r--r--src/compiler/nir/nir_builder.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index e4e0895d3af..3e3bdcd3b8d 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -88,10 +88,11 @@ nir_ssa_undef(nir_builder *build, unsigned num_components, unsigned bit_size)
}
static inline nir_ssa_def *
-nir_build_imm(nir_builder *build, unsigned num_components, nir_const_value value)
+nir_build_imm(nir_builder *build, unsigned num_components,
+ unsigned bit_size, nir_const_value value)
{
nir_load_const_instr *load_const =
- nir_load_const_instr_create(build->shader, num_components, 32);
+ nir_load_const_instr_create(build->shader, num_components, bit_size);
if (!load_const)
return NULL;
@@ -110,7 +111,7 @@ nir_imm_float(nir_builder *build, float x)
memset(&v, 0, sizeof(v));
v.f32[0] = x;
- return nir_build_imm(build, 1, v);
+ return nir_build_imm(build, 1, 32, v);
}
static inline nir_ssa_def *
@@ -124,7 +125,7 @@ nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
v.f32[2] = z;
v.f32[3] = w;
- return nir_build_imm(build, 4, v);
+ return nir_build_imm(build, 4, 32, v);
}
static inline nir_ssa_def *
@@ -135,7 +136,7 @@ nir_imm_int(nir_builder *build, int x)
memset(&v, 0, sizeof(v));
v.i32[0] = x;
- return nir_build_imm(build, 1, v);
+ return nir_build_imm(build, 1, 32, v);
}
static inline nir_ssa_def *
@@ -149,7 +150,7 @@ nir_imm_ivec4(nir_builder *build, int x, int y, int z, int w)
v.i32[2] = z;
v.i32[3] = w;
- return nir_build_imm(build, 4, v);
+ return nir_build_imm(build, 4, 32, v);
}
static inline nir_ssa_def *