summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-12-03 17:03:19 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:03 -0800
commit27663dbe8edfb7583d9d8fc3704a04a5c837fe05 (patch)
tree86a274c5438b6d78c3454919fa56c754cd6617ae /src/glsl/nir/nir.h
parentd1d12efb36074abd34d6d6d3aa4db9190f6c0de3 (diff)
nir: Vectorize intrinsics
We used to have the number of components built into the intrinsic. This meant that all of our load/store intrinsics had vec1, vec2, vec3, and vec4 variants. This lead to piles of switch statements to generate the correct intrinsic names, and introspection to figure out the number of components. We can make things much nicer by allowing "vectorized" intrinsics. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r--src/glsl/nir/nir.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index a0a16c1d3a8..ff1f7964fce 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -693,6 +693,9 @@ typedef struct {
nir_dest dest;
+ /** number of components if this is a vectorized intrinsic */
+ uint8_t num_components;
+
int const_index[3];
nir_deref_var *variables[2];
@@ -732,12 +735,20 @@ typedef struct {
unsigned num_srcs; /** < number of register/SSA inputs */
- /** number of components of each input register */
+ /** number of components of each input register
+ *
+ * If this value is 0, the number of components is given by the
+ * num_components field of nir_intrinsic_instr.
+ */
unsigned src_components[NIR_INTRINSIC_MAX_INPUTS];
bool has_dest;
- /** number of components of each output register */
+ /** number of components of the output register
+ *
+ * If this value is 0, the number of components is given by the
+ * num_components field of nir_intrinsic_instr.
+ */
unsigned dest_components;
/** the number of inputs/outputs that are variables */