[Mesa-dev] [PATCH 14/20] mesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)

Dave Airlie airlied at gmail.com
Mon Jul 20 22:19:21 PDT 2015


From: Dave Airlie <airlied at redhat.com>

This adds the necessary storage for subroutine info to gl_shader.

v2: add comments, rename one member
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/main/mtypes.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 10c3954..046ba04 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2360,6 +2360,15 @@ struct gl_ati_fragment_shader_state
    struct ati_fragment_shader *Current;
 };
 
+/**
+ *  Shader subroutine function definition
+ */
+struct gl_subroutine_function
+{
+   char *name;
+   int num_compat_types;
+   const struct glsl_type **types;
+};
 
 /**
  * A GLSL vertex or fragment shader object.
@@ -2510,6 +2519,25 @@ struct gl_shader
        */
       unsigned LocalSize[3];
    } Comp;
+
+   /**
+     * Number of types for subroutine uniforms.
+     */
+   GLuint NumSubroutineUniformTypes;
+
+   /**
+     * Subroutine uniform remap table
+     * based on the program level uniform remap table.
+     */
+   GLuint NumSubroutineUniformRemapTable;
+   struct gl_uniform_storage **SubroutineUniformRemapTable;
+
+   /**
+    * Num of subroutine functions for this stage
+    * and storage for them.
+    */
+   GLuint NumSubroutineFunctions;
+   struct gl_subroutine_function *SubroutineFunctions;
 };
 
 
-- 
2.4.3



More information about the mesa-dev mailing list