diff options
author | Kenneth Graunke <[email protected]> | 2015-08-18 01:48:34 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-08-25 11:12:35 -0700 |
commit | d4d5b430a52aab148c8697deaedd8864e1749f3c (patch) | |
tree | ef0d69d5b22fb224bab921cb1b897935f9f3d62e /src/glsl/nir/nir.c | |
parent | dfacae3a56463e2df3a67e245f868e9f2be64dcd (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.c')
-rw-r--r-- | src/glsl/nir/nir.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 5115f241e2f..77cc4f078a3 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -30,7 +30,9 @@ #include <assert.h> nir_shader * -nir_shader_create(void *mem_ctx, const nir_shader_compiler_options *options) +nir_shader_create(void *mem_ctx, + gl_shader_stage stage, + const nir_shader_compiler_options *options) { nir_shader *shader = ralloc(mem_ctx, nir_shader); @@ -50,6 +52,8 @@ nir_shader_create(void *mem_ctx, const nir_shader_compiler_options *options) shader->num_outputs = 0; shader->num_uniforms = 0; + shader->stage = stage; + return shader; } |