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 (* UpdateVarying
) (struct gl2_program_intf
**, GLuint
, GLfloat
*, GLboolean
);
99 struct gl2_fragment_shader_intf
101 struct gl2_shader_intf _shader
;
104 struct gl2_vertex_shader_intf
106 struct gl2_shader_intf _shader
;
109 struct gl2_3dlabs_shhandle_intf
111 struct gl2_unknown_intf _unknown
;
112 GLvoid
*(* GetShHandle
) (struct gl2_3dlabs_shhandle_intf
**);
116 #if FEATURE_ARB_shader_objects
118 extern void GLAPIENTRY
119 _mesa_DeleteObjectARB(GLhandleARB obj
);
121 extern GLhandleARB GLAPIENTRY
122 _mesa_GetHandleARB(GLenum pname
);
124 extern void GLAPIENTRY
125 _mesa_DetachObjectARB (GLhandleARB
, GLhandleARB
);
127 extern GLhandleARB GLAPIENTRY
128 _mesa_CreateShaderObjectARB (GLenum
);
130 extern void GLAPIENTRY
131 _mesa_ShaderSourceARB (GLhandleARB
, GLsizei
, const GLcharARB
* *, const GLint
*);
133 extern void GLAPIENTRY
134 _mesa_CompileShaderARB (GLhandleARB
);
136 extern GLhandleARB GLAPIENTRY
137 _mesa_CreateProgramObjectARB (void);
139 extern void GLAPIENTRY
140 _mesa_AttachObjectARB (GLhandleARB
, GLhandleARB
);
142 extern void GLAPIENTRY
143 _mesa_LinkProgramARB (GLhandleARB
);
145 extern void GLAPIENTRY
146 _mesa_UseProgramObjectARB (GLhandleARB
);
148 extern void GLAPIENTRY
149 _mesa_ValidateProgramARB (GLhandleARB
);
151 extern void GLAPIENTRY
152 _mesa_Uniform1fARB (GLint
, GLfloat
);
154 extern void GLAPIENTRY
155 _mesa_Uniform2fARB (GLint
, GLfloat
, GLfloat
);
157 extern void GLAPIENTRY
158 _mesa_Uniform3fARB (GLint
, GLfloat
, GLfloat
, GLfloat
);
160 extern void GLAPIENTRY
161 _mesa_Uniform4fARB (GLint
, GLfloat
, GLfloat
, GLfloat
, GLfloat
);
163 extern void GLAPIENTRY
164 _mesa_Uniform1iARB (GLint
, GLint
);
166 extern void GLAPIENTRY
167 _mesa_Uniform2iARB (GLint
, GLint
, GLint
);
169 extern void GLAPIENTRY
170 _mesa_Uniform3iARB (GLint
, GLint
, GLint
, GLint
);
172 extern void GLAPIENTRY
173 _mesa_Uniform4iARB (GLint
, GLint
, GLint
, GLint
, GLint
);
175 extern void GLAPIENTRY
176 _mesa_Uniform1fvARB (GLint
, GLsizei
, const GLfloat
*);
178 extern void GLAPIENTRY
179 _mesa_Uniform2fvARB (GLint
, GLsizei
, const GLfloat
*);
181 extern void GLAPIENTRY
182 _mesa_Uniform3fvARB (GLint
, GLsizei
, const GLfloat
*);
184 extern void GLAPIENTRY
185 _mesa_Uniform4fvARB (GLint
, GLsizei
, const GLfloat
*);
187 extern void GLAPIENTRY
188 _mesa_Uniform1ivARB (GLint
, GLsizei
, const GLint
*);
190 extern void GLAPIENTRY
191 _mesa_Uniform2ivARB (GLint
, GLsizei
, const GLint
*);
193 extern void GLAPIENTRY
194 _mesa_Uniform3ivARB (GLint
, GLsizei
, const GLint
*);
196 extern void GLAPIENTRY
197 _mesa_Uniform4ivARB (GLint
, GLsizei
, const GLint
*);
199 extern void GLAPIENTRY
200 _mesa_UniformMatrix2fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
202 extern void GLAPIENTRY
203 _mesa_UniformMatrix3fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
205 extern void GLAPIENTRY
206 _mesa_UniformMatrix4fvARB (GLint
, GLsizei
, GLboolean
, const GLfloat
*);
208 extern void GLAPIENTRY
209 _mesa_GetObjectParameterfvARB (GLhandleARB
, GLenum
, GLfloat
*);
211 extern void GLAPIENTRY
212 _mesa_GetObjectParameterivARB (GLhandleARB
, GLenum
, GLint
*);
214 extern void GLAPIENTRY
215 _mesa_GetInfoLogARB (GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
217 extern void GLAPIENTRY
218 _mesa_GetAttachedObjectsARB (GLhandleARB
, GLsizei
, GLsizei
*, GLhandleARB
*);
220 extern GLint GLAPIENTRY
221 _mesa_GetUniformLocationARB (GLhandleARB
, const GLcharARB
*);
223 extern void GLAPIENTRY
224 _mesa_GetActiveUniformARB (GLhandleARB
, GLuint
, GLsizei
, GLsizei
*, GLint
*, GLenum
*, GLcharARB
*);
226 extern void GLAPIENTRY
227 _mesa_GetUniformfvARB (GLhandleARB
, GLint
, GLfloat
*);
229 extern void GLAPIENTRY
230 _mesa_GetUniformivARB (GLhandleARB
, GLint
, GLint
*);
232 extern void GLAPIENTRY
233 _mesa_GetShaderSourceARB (GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
235 #if FEATURE_ARB_vertex_shader
237 extern void GLAPIENTRY
238 _mesa_BindAttribLocationARB (GLhandleARB
, GLuint
, const GLcharARB
*);
240 extern void GLAPIENTRY
241 _mesa_GetActiveAttribARB (GLhandleARB
, GLuint
, GLsizei
, GLsizei
*, GLint
*, GLenum
*, GLcharARB
*);
243 extern GLint GLAPIENTRY
244 _mesa_GetAttribLocationARB (GLhandleARB
, const GLcharARB
*);
246 #endif /* FEATURE_ARB_vertex_shader */
249 _mesa_init_shaderobjects (GLcontext
*ctx
);
251 #endif /* FEATURE_ARB_shader_objects */
253 #endif /* SHADEROBJECTS_H */