2 * Mesa 3-D graphics library
5 * Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef SHADEROBJECTS_H
26 #define SHADEROBJECTS_H
31 * gl2 unique interface identifier.
32 * Each gl2 interface has its own interface id used for object queries.
36 UIID_UNKNOWN
, /* supported by all objects */
37 UIID_GENERIC
, /* generic object */
38 UIID_CONTAINER
, /* contains generic objects */
39 UIID_SHADER
, /* shader object */
40 UIID_FRAGMENT_SHADER
, /* fragment shader */
41 UIID_VERTEX_SHADER
, /* vertex shader */
42 UIID_PROGRAM
, /* program object */
43 UIID_3DLABS_SHHANDLE
/* encapsulates 3dlabs' ShHandle */
46 struct gl2_unknown_intf
48 GLvoid (* AddRef
) (struct gl2_unknown_intf
**);
49 GLvoid (* Release
) (struct gl2_unknown_intf
**);
50 struct gl2_unknown_intf
**(* QueryInterface
) (struct gl2_unknown_intf
**, enum gl2_uiid uiid
);
53 struct gl2_generic_intf
55 struct gl2_unknown_intf _unknown
;
56 GLvoid (* Delete
) (struct gl2_generic_intf
**);
57 GLenum (* GetType
) (struct gl2_generic_intf
**);
58 GLhandleARB (* GetName
) (struct gl2_generic_intf
**);
59 GLboolean (* GetDeleteStatus
) (struct gl2_generic_intf
**);
60 const GLcharARB
*(* GetInfoLog
) (struct gl2_generic_intf
**);
63 struct gl2_container_intf
65 struct gl2_generic_intf _generic
;
66 GLboolean (* Attach
) (struct gl2_container_intf
**, struct gl2_generic_intf
**);
67 GLboolean (* Detach
) (struct gl2_container_intf
**, struct gl2_generic_intf
**);
68 GLsizei (* GetAttachedCount
) (struct gl2_container_intf
**);
69 struct gl2_generic_intf
**(* GetAttached
) (struct gl2_container_intf
**, GLuint
);
72 struct gl2_shader_intf
74 struct gl2_generic_intf _generic
;
75 GLenum (* GetSubType
) (struct gl2_shader_intf
**);
76 GLboolean (* GetCompileStatus
) (struct gl2_shader_intf
**);
77 GLvoid (* SetSource
) (struct gl2_shader_intf
**, GLcharARB
*, GLint
*, GLsizei
);
78 const GLcharARB
*(* GetSource
) (struct gl2_shader_intf
**);
79 GLvoid (* Compile
) (struct gl2_shader_intf
**);
82 struct gl2_program_intf
84 struct gl2_container_intf _container
;
85 GLboolean (* GetLinkStatus
) (struct gl2_program_intf
**);
86 GLboolean (* GetValidateStatus
) (struct gl2_program_intf
**);
87 GLvoid (* Link
) (struct gl2_program_intf
**);
88 GLvoid (* Validate
) (struct gl2_program_intf
**);
89 GLvoid (* UpdateFixedUniforms
) (struct gl2_program_intf
**);
90 GLvoid (* UpdateFixedAttribute
) (struct gl2_program_intf
**, GLuint
, GLvoid
*, GLuint
, GLuint
,
92 GLvoid (* UpdateFixedVarying
) (struct gl2_program_intf
**, GLuint
, GLvoid
*, GLuint
, GLuint
,
94 GLvoid (* GetTextureImageUsage
) (struct gl2_program_intf
**, GLbitfield
*);
95 GLboolean (* IsShaderPresent
) (struct gl2_program_intf
**, GLenum
);
96 GLvoid (* GetActiveUniform
) (struct gl2_program_intf
**, GLuint index
, GLsizei maxLength
,
97 GLsizei
*length
, GLint
*size
, GLenum
*type
, GLchar
*name
);
98 GLuint (* GetActiveUniformMaxLength
) (struct gl2_program_intf
**);
99 GLuint (* GetActiveUniformCount
) (struct gl2_program_intf
**);
100 GLint (* GetUniformLocation
) (struct gl2_program_intf
**, const GLchar
*name
);
101 GLboolean (* WriteUniform
) (struct gl2_program_intf
**, GLint loc
, GLsizei count
,
102 const GLvoid
*data
, GLenum type
);
103 GLvoid (* GetActiveAttrib
) (struct gl2_program_intf
**, GLuint index
, GLsizei maxLength
,
104 GLsizei
*length
, GLint
*size
, GLenum
*type
, GLchar
*name
);
105 GLuint (* GetActiveAttribMaxLength
) (struct gl2_program_intf
**);
106 GLuint (* GetActiveAttribCount
) (struct gl2_program_intf
**);
107 GLint (* GetAttribLocation
) (struct gl2_program_intf
**, const GLchar
*name
);
108 GLvoid (* OverrideAttribBinding
) (struct gl2_program_intf
**, GLuint
, const GLchar
*);
109 GLvoid (* UpdateVarying
) (struct gl2_program_intf
**, GLuint
, GLfloat
*, GLboolean
);
112 struct gl2_fragment_shader_intf
114 struct gl2_shader_intf _shader
;
117 struct gl2_vertex_shader_intf
119 struct gl2_shader_intf _shader
;
122 struct gl2_3dlabs_shhandle_intf
124 struct gl2_unknown_intf _unknown
;
125 GLvoid
*(* GetShHandle
) (struct gl2_3dlabs_shhandle_intf
**);
129 #if FEATURE_ARB_shader_objects
131 extern void GLAPIENTRY
132 _mesa_DeleteObjectARB(GLhandleARB obj
);
134 extern GLhandleARB GLAPIENTRY
135 _mesa_GetHandleARB(GLenum pname
);
137 extern void GLAPIENTRY
138 _mesa_DetachObjectARB (GLhandleARB
, GLhandleARB
);
140 extern GLhandleARB GLAPIENTRY
141 _mesa_CreateShaderObjectARB (GLenum
);
143 extern void GLAPIENTRY
144 _mesa_ShaderSourceARB (GLhandleARB
, GLsizei
, const GLcharARB
* *, const GLint
*);
146 extern void GLAPIENTRY
147 _mesa_CompileShaderARB (GLhandleARB
);
149 extern GLhandleARB GLAPIENTRY
150 _mesa_CreateProgramObjectARB (void);
152 extern void GLAPIENTRY
153 _mesa_AttachObjectARB (GLhandleARB
, GLhandleARB
);
155 extern void GLAPIENTRY
156 _mesa_LinkProgramARB (GLhandleARB
);
158 extern void GLAPIENTRY
159 _mesa_UseProgramObjectARB (GLhandleARB
);
161 extern void GLAPIENTRY
162 _mesa_ValidateProgramARB (GLhandleARB
);
164 extern void GLAPIENTRY
165 _mesa_Uniform1fARB (GLint
, GLfloat
);
167 extern void GLAPIENTRY
168 _mesa_Uniform2fARB (GLint
, GLfloat
, GLfloat
);
170 extern void GLAPIENTRY
171 _mesa_Uniform3fARB (GLint
, GLfloat
, GLfloat
, GLfloat
);
173 extern void GLAPIENTRY
174 _mesa_Uniform4fARB (GLint
, GLfloat
, GLfloat
, GLfloat
, GLfloat
);
176 extern void GLAPIENTRY
177 _mesa_Uniform1iARB (GLint
, GLint
);
179 extern void GLAPIENTRY
180 _mesa_Uniform2iARB (GLint
, GLint
, GLint
);
182 extern void GLAPIENTRY
183 _mesa_Uniform3iARB (GLint
, GLint
, GLint
, GLint
);
185 extern void GLAPIENTRY
186 _mesa_Uniform4iARB (GLint
, GLint
, GLint
, GLint
, GLint
);
188 extern void GLAPIENTRY
189 _mesa_Uniform1fvARB (GLint
, GLsizei
, const GLfloat
*);
191 extern void GLAPIENTRY
192 _mesa_Uniform2fvARB (GLint
, GLsizei
, const GLfloat
*);
194 extern void GLAPIENTRY
195 _mesa_Uniform3fvARB (GLint
, GLsizei
, const GLfloat
*);
197 extern void GLAPIENTRY
198 _mesa_Uniform4fvARB (GLint
, GLsizei
, const GLfloat
*);
200 extern void GLAPIENTRY
201 _mesa_Uniform1ivARB (GLint
, GLsizei
, const GLint
*);
203 extern void GLAPIENTRY
204 _mesa_Uniform2ivARB (GLint
, GLsizei
, const GLint
*);
206 extern void GLAPIENTRY
207 _mesa_Uniform3ivARB (GLint
, GLsizei
, const GLint
*);
209 extern void GLAPIENTRY
210 _mesa_Uniform4ivARB (GLint
, GLsizei
, const GLint
*);
212 extern void GLAPIENTRY
213 _mesa_UniformMatrix2fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
215 extern void GLAPIENTRY
216 _mesa_UniformMatrix3fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
218 extern void GLAPIENTRY
219 _mesa_UniformMatrix4fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
221 extern void GLAPIENTRY
222 _mesa_GetObjectParameterfvARB (GLhandleARB
, GLenum
, GLfloat
*);
224 extern void GLAPIENTRY
225 _mesa_GetObjectParameterivARB (GLhandleARB
, GLenum
, GLint
*);
227 extern void GLAPIENTRY
228 _mesa_GetInfoLogARB (GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
230 extern void GLAPIENTRY
231 _mesa_GetAttachedObjectsARB (GLhandleARB
, GLsizei
, GLsizei
*, GLhandleARB
*);
233 extern GLint GLAPIENTRY
234 _mesa_GetUniformLocationARB (GLhandleARB
, const GLcharARB
*);
236 extern void GLAPIENTRY
237 _mesa_GetActiveUniformARB (GLhandleARB
, GLuint
, GLsizei
, GLsizei
*, GLint
*, GLenum
*, GLcharARB
*);
239 extern void GLAPIENTRY
240 _mesa_GetUniformfvARB (GLhandleARB
, GLint
, GLfloat
*);
242 extern void GLAPIENTRY
243 _mesa_GetUniformivARB (GLhandleARB
, GLint
, GLint
*);
245 extern void GLAPIENTRY
246 _mesa_GetShaderSourceARB (GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
248 #if FEATURE_ARB_vertex_shader
250 extern void GLAPIENTRY
251 _mesa_BindAttribLocationARB (GLhandleARB
, GLuint
, const GLcharARB
*);
253 extern void GLAPIENTRY
254 _mesa_GetActiveAttribARB (GLhandleARB
, GLuint
, GLsizei
, GLsizei
*, GLint
*, GLenum
*, GLcharARB
*);
256 extern GLint GLAPIENTRY
257 _mesa_GetAttribLocationARB (GLhandleARB
, const GLcharARB
*);
259 #endif /* FEATURE_ARB_vertex_shader */
262 _mesa_init_shaderobjects (GLcontext
*ctx
);
264 #endif /* FEATURE_ARB_shader_objects */
266 #endif /* SHADEROBJECTS_H */