diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-06-21 16:06:07 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-06-23 10:56:04 -0700 |
commit | 5edf6f98d8b7b945294c55284cefc8035d23ea8a (patch) | |
tree | 5239b965d81df040d54e8d1f7867f2104be11561 | |
parent | 8b80e9f9e3bc9ca41c95125826139471f73602c4 (diff) |
Import gl_uniform and gl_uniform_list types from Mesa
-rw-r--r-- | program.h | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -42,7 +42,40 @@ struct glsl_shader { struct gl_program_parameter_list; -struct gl_uniform_list; + +/** + * Shader program uniform variable. + * The glGetUniformLocation() and glUniform() commands will use this + * information. + * Note that a uniform such as "binormal" might be used in both the + * vertex shader and the fragment shader. When glUniform() is called to + * set the uniform's value, it must be updated in both the vertex and + * fragment shaders. The uniform may be in different locations in the + * two shaders so we keep track of that here. + */ +struct gl_uniform +{ + const char *Name; /**< Null-terminated string */ + GLint VertPos; + GLint FragPos; + GLboolean Initialized; /**< For debug. Has this uniform been set? */ +#if 0 + GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ + GLuint Size; /**< Number of components (1..4) */ +#endif +}; + + +/** + * List of gl_uniforms + */ +struct gl_uniform_list +{ + GLuint Size; /**< allocated size of Uniforms array */ + GLuint NumUniforms; /**< number of uniforms in the array */ + struct gl_uniform *Uniforms; /**< Array [Size] */ +}; + /** * Based on gl_shader_program in Mesa's mtypes.h. |