diff options
Diffstat (limited to 'src/glsl/nir')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 2 | ||||
-rw-r--r-- | src/glsl/nir/nir.c | 6 | ||||
-rw-r--r-- | src/glsl/nir/nir.h | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 614d1dd9b70..9cc065f25a9 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -132,7 +132,7 @@ private: nir_shader * glsl_to_nir(struct gl_shader *sh, const nir_shader_compiler_options *options) { - nir_shader *shader = nir_shader_create(NULL, options); + nir_shader *shader = nir_shader_create(NULL, sh->Stage, options); nir_visitor v1(shader, sh->Stage); nir_function_visitor v2(&v1); 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; } 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 */ |