mesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)
authorDave Airlie <airlied@redhat.com>
Tue, 21 Jul 2015 04:59:01 +0000 (14:59 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 23 Jul 2015 07:25:39 +0000 (17:25 +1000)
This adds the necessary storage for subroutine info to gl_shader.

v2: add comments, rename one member
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/mtypes.h

index c5673e268dbcbd831682b8c65838b4bd44dcea7e..a252bf46606c068fedd60f52e712c8d5800e8d9c 100644 (file)
@@ -2414,6 +2414,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.
@@ -2600,6 +2609,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;
 };