diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-06-10 21:14:03 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-13 13:27:39 +0200 |
commit | c9689d5d14fd21e1e6e63a4ee6b166b57129ead5 (patch) | |
tree | 065950228b0d90c919c250f56f10212469f98f27 | |
parent | 91c8e79e01a3f68fc4e9a4dab69fb559ce2ddf50 (diff) |
mesa: add gl_shader::nir and nir_entry
-rw-r--r-- | src/mesa/main/mtypes.h | 10 | ||||
-rw-r--r-- | src/mesa/main/shaderapi.c | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 79aa58a113..6ee0e9be6a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -88,6 +88,8 @@ struct gl_uniform_storage; struct prog_instruction; struct gl_program_parameter_list; struct gl_spirv_module; +struct nir_function; +struct nir_shader; struct set; struct set_entry; struct vbo_context; @@ -2586,6 +2588,14 @@ struct gl_shader struct glsl_symbol_table *symbols; /** + * Specialized SPIR-V shader. + */ + /*@{*/ + struct nir_shader *nir; + struct nir_function *nir_entry; + /*@}*/ + + /** * A bitmask of gl_advanced_blend_mode values */ GLbitfield BlendSupport; diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 48e61387f2..f5a437c101 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1036,6 +1036,9 @@ shader_source(struct gl_shader *sh, const GLchar *source) * completion of this command the SPIR_V_BINARY_ARB state of <shader> * is set to FALSE." */ + ralloc_free(sh->nir); + sh->nir = NULL; + sh->nir_entry = NULL; _mesa_spirv_module_reference(&sh->SpirVModule, NULL); sh->SpirVBinary = GL_FALSE; |