3f6c0ff0cbabe3e095e1336c96462aa7942e86b9
2 * Mesa 3-D graphics library
4 * Copyright (C) 2004-2007 Brian Paul All Rights Reserved.
5 * Copyright (C) 2010 VMware, Inc. 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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
41 struct gl_shader_program
;
44 _mesa_get_shader_flags(void);
47 _mesa_get_shader_capture_path(void);
50 _mesa_copy_string(GLchar
*dst
, GLsizei maxLength
,
51 GLsizei
*length
, const GLchar
*src
);
54 _mesa_use_shader_program(struct gl_context
*ctx
,
55 struct gl_shader_program
*shProg
);
58 _mesa_active_program(struct gl_context
*ctx
, struct gl_shader_program
*shProg
,
62 _mesa_compile_shader(struct gl_context
*ctx
, struct gl_shader
*sh
);
65 _mesa_link_program(struct gl_context
*ctx
, struct gl_shader_program
*sh_prog
);
68 _mesa_count_active_attribs(struct gl_shader_program
*shProg
);
71 _mesa_longest_attribute_name_length(struct gl_shader_program
*shProg
);
74 _mesa_shader_write_subroutine_indices(struct gl_context
*ctx
,
75 gl_shader_stage stage
);
78 _mesa_AttachObjectARB_no_error(GLhandleARB
, GLhandleARB
);
80 extern void GLAPIENTRY
81 _mesa_AttachObjectARB(GLhandleARB
, GLhandleARB
);
83 extern void GLAPIENTRY
84 _mesa_CompileShader(GLuint
);
86 extern GLhandleARB GLAPIENTRY
87 _mesa_CreateProgramObjectARB(void);
89 extern GLhandleARB GLAPIENTRY
90 _mesa_CreateShaderObjectARB(GLenum type
);
92 extern void GLAPIENTRY
93 _mesa_DeleteObjectARB(GLhandleARB obj
);
95 extern void GLAPIENTRY
96 _mesa_DetachObjectARB(GLhandleARB
, GLhandleARB
);
98 extern void GLAPIENTRY
99 _mesa_GetAttachedObjectsARB(GLhandleARB
, GLsizei
, GLsizei
*, GLhandleARB
*);
101 extern GLint GLAPIENTRY
102 _mesa_GetFragDataLocation(GLuint program
, const GLchar
*name
);
104 extern GLint GLAPIENTRY
105 _mesa_GetFragDataIndex(GLuint program
, const GLchar
*name
);
107 extern GLhandleARB GLAPIENTRY
108 _mesa_GetHandleARB(GLenum pname
);
110 extern void GLAPIENTRY
111 _mesa_GetInfoLogARB(GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
113 extern void GLAPIENTRY
114 _mesa_GetObjectParameterfvARB(GLhandleARB
, GLenum
, GLfloat
*);
116 extern void GLAPIENTRY
117 _mesa_GetObjectParameterivARB(GLhandleARB
, GLenum
, GLint
*);
119 extern void GLAPIENTRY
120 _mesa_GetShaderSource(GLuint
, GLsizei
, GLsizei
*, GLchar
*);
122 extern GLboolean GLAPIENTRY
123 _mesa_IsProgram(GLuint name
);
125 extern GLboolean GLAPIENTRY
126 _mesa_IsShader(GLuint name
);
128 extern void GLAPIENTRY
129 _mesa_LinkProgram(GLuint programObj
);
131 extern void GLAPIENTRY
132 _mesa_ShaderSource(GLuint
, GLsizei
, const GLchar
* const *, const GLint
*);
135 _mesa_UseProgram_no_error(GLuint
);
136 extern void GLAPIENTRY
137 _mesa_UseProgram(GLuint
);
139 extern void GLAPIENTRY
140 _mesa_ValidateProgram(GLuint
);
143 extern void GLAPIENTRY
144 _mesa_BindAttribLocation(GLuint program
, GLuint
, const GLchar
*);
146 extern void GLAPIENTRY
147 _mesa_BindFragDataLocation(GLuint program
, GLuint colorNumber
,
150 extern void GLAPIENTRY
151 _mesa_BindFragDataLocationIndexed(GLuint program
, GLuint colorNumber
,
152 GLuint index
, const GLchar
*name
);
154 extern void GLAPIENTRY
155 _mesa_GetActiveAttrib(GLuint
, GLuint
, GLsizei
, GLsizei
*, GLint
*,
158 extern GLint GLAPIENTRY
159 _mesa_GetAttribLocation(GLuint
, const GLchar
*);
162 _mesa_AttachShader_no_error(GLuint program
, GLuint shader
);
164 extern void GLAPIENTRY
165 _mesa_AttachShader(GLuint program
, GLuint shader
);
167 extern GLuint GLAPIENTRY
168 _mesa_CreateShader(GLenum
);
170 extern GLuint GLAPIENTRY
171 _mesa_CreateProgram(void);
173 extern void GLAPIENTRY
174 _mesa_DeleteProgram(GLuint program
);
176 extern void GLAPIENTRY
177 _mesa_DeleteShader(GLuint shader
);
179 extern void GLAPIENTRY
180 _mesa_DetachShader(GLuint program
, GLuint shader
);
182 extern void GLAPIENTRY
183 _mesa_GetAttachedShaders(GLuint program
, GLsizei maxCount
,
184 GLsizei
*count
, GLuint
*obj
);
186 extern void GLAPIENTRY
187 _mesa_GetProgramiv(GLuint program
, GLenum pname
, GLint
*params
);
189 extern void GLAPIENTRY
190 _mesa_GetProgramInfoLog(GLuint program
, GLsizei bufSize
,
191 GLsizei
*length
, GLchar
*infoLog
);
193 extern void GLAPIENTRY
194 _mesa_GetShaderiv(GLuint shader
, GLenum pname
, GLint
*params
);
196 extern void GLAPIENTRY
197 _mesa_GetShaderInfoLog(GLuint shader
, GLsizei bufSize
,
198 GLsizei
*length
, GLchar
*infoLog
);
201 extern void GLAPIENTRY
202 _mesa_GetShaderPrecisionFormat(GLenum shadertype
, GLenum precisiontype
,
203 GLint
*range
, GLint
*precision
);
205 extern void GLAPIENTRY
206 _mesa_ReleaseShaderCompiler(void);
208 extern void GLAPIENTRY
209 _mesa_ShaderBinary(GLint n
, const GLuint
*shaders
, GLenum binaryformat
,
210 const void* binary
, GLint length
);
212 extern void GLAPIENTRY
213 _mesa_GetProgramBinary(GLuint program
, GLsizei bufSize
, GLsizei
*length
,
214 GLenum
*binaryFormat
, GLvoid
*binary
);
216 extern void GLAPIENTRY
217 _mesa_ProgramBinary(GLuint program
, GLenum binaryFormat
,
218 const GLvoid
*binary
, GLsizei length
);
220 extern void GLAPIENTRY
221 _mesa_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
);
224 _mesa_use_program(struct gl_context
*ctx
, gl_shader_stage stage
,
225 struct gl_shader_program
*shProg
, struct gl_program
*prog
,
226 struct gl_pipeline_object
*shTarget
);
229 _mesa_copy_linked_program_data(const struct gl_shader_program
*src
,
230 struct gl_linked_shader
*dst_sh
);
233 _mesa_validate_shader_target(const struct gl_context
*ctx
, GLenum type
);
236 /* GL_ARB_separate_shader_objects */
237 extern GLuint GLAPIENTRY
238 _mesa_CreateShaderProgramv(GLenum type
, GLsizei count
,
239 const GLchar
* const *strings
);
241 /* GL_ARB_program_resource_query */
243 _mesa_program_resource_name(struct gl_program_resource
*res
);
246 _mesa_program_resource_array_size(struct gl_program_resource
*res
);
249 _mesa_program_resource_index(struct gl_shader_program
*shProg
,
250 struct gl_program_resource
*res
);
252 extern struct gl_program_resource
*
253 _mesa_program_resource_find_name(struct gl_shader_program
*shProg
,
254 GLenum programInterface
, const char *name
,
255 unsigned *array_index
);
257 extern struct gl_program_resource
*
258 _mesa_program_resource_find_index(struct gl_shader_program
*shProg
,
259 GLenum programInterface
, GLuint index
);
262 _mesa_get_program_resource_name(struct gl_shader_program
*shProg
,
263 GLenum programInterface
, GLuint index
,
264 GLsizei bufSize
, GLsizei
*length
,
265 GLchar
*name
, const char *caller
);
268 _mesa_program_resource_name_len(struct gl_program_resource
*res
);
271 _mesa_program_resource_location(struct gl_shader_program
*shProg
,
272 GLenum programInterface
, const char *name
);
275 _mesa_program_resource_location_index(struct gl_shader_program
*shProg
,
276 GLenum programInterface
, const char *name
);
279 _mesa_program_resource_prop(struct gl_shader_program
*shProg
,
280 struct gl_program_resource
*res
, GLuint index
,
281 const GLenum prop
, GLint
*val
, const char *caller
);
284 _mesa_get_program_resourceiv(struct gl_shader_program
*shProg
,
285 GLenum programInterface
, GLuint index
,
286 GLsizei propCount
, const GLenum
*props
,
287 GLsizei bufSize
, GLsizei
*length
,
290 /* GL_ARB_tessellation_shader */
291 extern void GLAPIENTRY
292 _mesa_PatchParameteri(GLenum pname
, GLint value
);
294 extern void GLAPIENTRY
295 _mesa_PatchParameterfv(GLenum pname
, const GLfloat
*values
);
297 /* GL_ARB_shader_subroutine */
299 _mesa_program_init_subroutine_defaults(struct gl_context
*ctx
,
300 struct gl_program
*prog
);
302 extern GLint GLAPIENTRY
303 _mesa_GetSubroutineUniformLocation(GLuint program
, GLenum shadertype
,
306 extern GLuint GLAPIENTRY
307 _mesa_GetSubroutineIndex(GLuint program
, GLenum shadertype
,
310 extern GLvoid GLAPIENTRY
311 _mesa_GetActiveSubroutineUniformiv(GLuint program
, GLenum shadertype
,
312 GLuint index
, GLenum pname
, GLint
*values
);
314 extern GLvoid GLAPIENTRY
315 _mesa_GetActiveSubroutineUniformName(GLuint program
, GLenum shadertype
,
316 GLuint index
, GLsizei bufsize
,
317 GLsizei
*length
, GLchar
*name
);
319 extern GLvoid GLAPIENTRY
320 _mesa_GetActiveSubroutineName(GLuint program
, GLenum shadertype
,
321 GLuint index
, GLsizei bufsize
,
322 GLsizei
*length
, GLchar
*name
);
324 extern GLvoid GLAPIENTRY
325 _mesa_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
326 const GLuint
*indices
);
328 extern GLvoid GLAPIENTRY
329 _mesa_GetUniformSubroutineuiv(GLenum shadertype
, GLint location
,
332 extern GLvoid GLAPIENTRY
333 _mesa_GetProgramStageiv(GLuint program
, GLenum shadertype
,
334 GLenum pname
, GLint
*values
);
340 #endif /* SHADERAPI_H */