Mesa (master): mesa: Add a reference to gl_shader_spirv_data to gl_linked_shader

Alejandro Pinheiro apinheiro at kemper.freedesktop.org
Fri Mar 30 10:30:46 UTC 2018


Module: Mesa
Branch: master
Commit: 22b6b3d0a75406f577dcb6d554c96ed42ee35aff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=22b6b3d0a75406f577dcb6d554c96ed42ee35aff

Author: Eduardo Lima Mitev <elima at igalia.com>
Date:   Mon Nov 13 19:44:47 2017 +0100

mesa: Add a reference to gl_shader_spirv_data to gl_linked_shader

This is a reference to the spirv_data object stored in gl_shader, which
stores shader SPIR-V data that is needed during linking too.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/mesa/main/mtypes.h    | 8 ++++++++
 src/mesa/main/shaderobj.c | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9ded02500d..801bd17666 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2651,6 +2651,14 @@ struct gl_linked_shader
    struct exec_list *packed_varyings;
    struct exec_list *fragdata_arrays;
    struct glsl_symbol_table *symbols;
+
+   /**
+    * ARB_gl_spirv related data.
+    *
+    * This is actually a reference to the gl_shader::spirv_data, which
+    * stores information that is also needed during linking.
+    */
+   struct gl_shader_spirv_data *spirv_data;
 };
 
 
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 5c1cdd6b27..834e2a92ec 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -137,6 +137,7 @@ void
 _mesa_delete_linked_shader(struct gl_context *ctx,
                            struct gl_linked_shader *sh)
 {
+   _mesa_shader_spirv_data_reference(&sh->spirv_data, NULL);
    _mesa_reference_program(ctx, &sh->Program, NULL);
    ralloc_free(sh);
 }




More information about the mesa-commit mailing list