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/mesa/program/prog_to_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/mesa/program/prog_to_nir.c')
-rw-r--r-- | src/mesa/program/prog_to_nir.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 9d4af120d4c..29ff638f7a5 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -33,6 +33,7 @@ #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_print.h" +#include "program.h" /** * \file prog_to_nir.c @@ -1081,11 +1082,12 @@ prog_to_nir(const struct gl_program *prog, { struct ptn_compile *c; struct nir_shader *s; + gl_shader_stage stage = _mesa_program_enum_to_shader_stage(prog->Target); c = rzalloc(NULL, struct ptn_compile); if (!c) return NULL; - s = nir_shader_create(NULL, options); + s = nir_shader_create(NULL, stage, options); if (!s) goto fail; c->prog = prog; |