summaryrefslogtreecommitdiff
path: root/src/mesa/main/mtypes.h
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2006-12-19 18:46:56 -0700
committerBrian <brian@yutani.localnet.net>2006-12-19 18:46:56 -0700
commit65a18442e5d846940714bb662f5b1bb47ab60c29 (patch)
treedb8554850401753e441a8c49b815f48f7df5a150 /src/mesa/main/mtypes.h
parent0bf5dbe002a64e198f55724cc1542602c012490f (diff)
Clean-up and re-org of the main GLSL object types.
Use the gl_shader struct as it should be. Renamed gl_linked_program to gl_shader_program. Store both shaders and programs in the same hash table and use the Type field to distinguish them.
Diffstat (limited to 'src/mesa/main/mtypes.h')
-rw-r--r--src/mesa/main/mtypes.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4a8f7d22e3..57f174a7d4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -45,6 +45,12 @@
/**
+ * Special, internal token
+ */
+#define GL_SHADER_PROGRAM 0x9999
+
+
+/**
* Color channel data type.
*/
#if CHAN_BITS == 8
@@ -2044,13 +2050,13 @@ struct gl_query_state
/**
* A GLSL shader object
- * A collection of one or more gl_programs...
*/
struct gl_shader
{
- GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER */
+ GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER (first field!) */
GLuint Name; /**< AKA the handle */
- GLchar *Source; /**< Source code string */
+ GLint RefCount;
+ const GLchar *Source; /**< Source code string */
GLboolean CompileStatus;
GLboolean DeletePending;
GLuint NumPrograms; /**< size of Programs[] array */
@@ -2061,15 +2067,14 @@ struct gl_shader
/**
* This corresponds to a GLSL "program" and is basically a linked collection
- * of "shaders" (which are Mesa gl_programs).
- * Yes, the terminology is a bit confusing.
+ * of "shaders".
*/
-struct gl_linked_program
+struct gl_shader_program
{
- GLenum Type;
+ GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */
GLuint Name; /**< aka handle or ID */
GLuint NumShaders; /**< total number of shaders in this program */
- struct gl_program **Shaders; /**< List of the shaders */
+ struct gl_shader **Shaders; /**< List of the shaders */
struct gl_vertex_program *VertexProgram; /**< Linked vertex program */
struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
struct gl_program_parameter_list *Uniforms; /**< Plus constants, etc */
@@ -2089,7 +2094,7 @@ struct gl_shader_state
{
GLboolean _VertexShaderPresent;
GLboolean _FragmentShaderPresent;
- struct gl_linked_program *CurrentProgram;
+ struct gl_shader_program *CurrentProgram;
};
@@ -2150,8 +2155,8 @@ struct gl_shared_state
#endif
#if FEATURE_ARB_shader_objects
+ /** Table of both gl_shader and gl_shader_program objects */
struct _mesa_HashTable *ShaderObjects;
- struct _mesa_HashTable *ProgramObjects;
#endif
#if FEATURE_EXT_framebuffer_object