summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-08-18 01:48:34 -0700
committerKenneth Graunke <[email protected]>2015-08-25 11:12:35 -0700
commitd4d5b430a52aab148c8697deaedd8864e1749f3c (patch)
treeef0d69d5b22fb224bab921cb1b897935f9f3d62e /src/glsl/nir/nir.h
parentdfacae3a56463e2df3a67e245f868e9f2be64dcd (diff)
nir: Store gl_shader_stage in nir_shader.
This makes it easy for NIR passes to inspect what kind of shader they're operating on. Thanks to Michel Dänzer for helping me figure out where TGSI stores the shader stage information. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r--src/glsl/nir/nir.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 011a80aed97..308298a5085 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1474,6 +1474,9 @@ typedef struct nir_shader {
* access plus one
*/
unsigned num_inputs, num_uniforms, num_outputs;
+
+ /** The shader stage, such as MESA_SHADER_VERTEX. */
+ gl_shader_stage stage;
} nir_shader;
#define nir_foreach_overload(shader, overload) \
@@ -1482,6 +1485,7 @@ typedef struct nir_shader {
&(func)->overload_list)
nir_shader *nir_shader_create(void *mem_ctx,
+ gl_shader_stage stage,
const nir_shader_compiler_options *options);
/** creates a register, including assigning it an index and adding it to the list */