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 GLhandleARB GLAPIENTRY
90 _mesa_CreateShaderObjectARB_no_error(GLenum type
);
92 extern GLhandleARB GLAPIENTRY
93 _mesa_CreateShaderObjectARB(GLenum type
);
95 extern void GLAPIENTRY
96 _mesa_DeleteObjectARB(GLhandleARB obj
);
99 _mesa_DetachObjectARB_no_error(GLhandleARB
, GLhandleARB
);
101 extern void GLAPIENTRY
102 _mesa_DetachObjectARB(GLhandleARB
, GLhandleARB
);
104 extern void GLAPIENTRY
105 _mesa_GetAttachedObjectsARB(GLhandleARB
, GLsizei
, GLsizei
*, GLhandleARB
*);
107 extern GLint GLAPIENTRY
108 _mesa_GetFragDataLocation(GLuint program
, const GLchar
*name
);
110 extern GLint GLAPIENTRY
111 _mesa_GetFragDataIndex(GLuint program
, const GLchar
*name
);
113 extern GLhandleARB GLAPIENTRY
114 _mesa_GetHandleARB(GLenum pname
);
116 extern void GLAPIENTRY
117 _mesa_GetInfoLogARB(GLhandleARB
, GLsizei
, GLsizei
*, GLcharARB
*);
119 extern void GLAPIENTRY
120 _mesa_GetObjectParameterfvARB(GLhandleARB
, GLenum
, GLfloat
*);
122 extern void GLAPIENTRY
123 _mesa_GetObjectParameterivARB(GLhandleARB
, GLenum
, GLint
*);
125 extern void GLAPIENTRY
126 _mesa_GetShaderSource(GLuint
, GLsizei
, GLsizei
*, GLchar
*);
128 extern GLboolean GLAPIENTRY
129 _mesa_IsProgram(GLuint name
);
131 extern GLboolean GLAPIENTRY
132 _mesa_IsShader(GLuint name
);
135 _mesa_LinkProgram_no_error(GLuint programObj
);
137 extern void GLAPIENTRY
138 _mesa_LinkProgram(GLuint programObj
);
141 _mesa_ShaderSource_no_error(GLuint
, GLsizei
, const GLchar
* const *,
144 extern void GLAPIENTRY
145 _mesa_ShaderSource(GLuint
, GLsizei
, const GLchar
* const *, const GLint
*);
148 _mesa_UseProgram_no_error(GLuint
);
149 extern void GLAPIENTRY
150 _mesa_UseProgram(GLuint
);
152 extern void GLAPIENTRY
153 _mesa_ValidateProgram(GLuint
);
157 _mesa_BindAttribLocation_no_error(GLuint program
, GLuint
, const GLchar
*);
159 extern void GLAPIENTRY
160 _mesa_BindAttribLocation(GLuint program
, GLuint
, const GLchar
*);
162 extern void GLAPIENTRY
163 _mesa_BindFragDataLocation(GLuint program
, GLuint colorNumber
,
166 extern void GLAPIENTRY
167 _mesa_BindFragDataLocationIndexed(GLuint program
, GLuint colorNumber
,
168 GLuint index
, const GLchar
*name
);
170 extern void GLAPIENTRY
171 _mesa_BindFragDataLocation_no_error(GLuint program
, GLuint colorNumber
,
174 extern void GLAPIENTRY
175 _mesa_BindFragDataLocationIndexed_no_error(GLuint program
, GLuint colorNumber
,
176 GLuint index
, const GLchar
*name
);
178 extern void GLAPIENTRY
179 _mesa_GetActiveAttrib(GLuint
, GLuint
, GLsizei
, GLsizei
*, GLint
*,
182 extern GLint GLAPIENTRY
183 _mesa_GetAttribLocation(GLuint
, const GLchar
*);
186 _mesa_AttachShader_no_error(GLuint program
, GLuint shader
);
188 extern void GLAPIENTRY
189 _mesa_AttachShader(GLuint program
, GLuint shader
);
192 _mesa_CreateShader_no_error(GLenum
);
194 extern GLuint GLAPIENTRY
195 _mesa_CreateShader(GLenum
);
197 extern GLuint GLAPIENTRY
198 _mesa_CreateProgram(void);
200 extern void GLAPIENTRY
201 _mesa_DeleteProgram(GLuint program
);
203 extern void GLAPIENTRY
204 _mesa_DeleteShader(GLuint shader
);
207 _mesa_DetachShader_no_error(GLuint program
, GLuint shader
);
209 extern void GLAPIENTRY
210 _mesa_DetachShader(GLuint program
, GLuint shader
);
212 extern void GLAPIENTRY
213 _mesa_GetAttachedShaders(GLuint program
, GLsizei maxCount
,
214 GLsizei
*count
, GLuint
*obj
);
216 extern void GLAPIENTRY
217 _mesa_GetProgramiv(GLuint program
, GLenum pname
, GLint
*params
);
219 extern void GLAPIENTRY
220 _mesa_GetProgramInfoLog(GLuint program
, GLsizei bufSize
,
221 GLsizei
*length
, GLchar
*infoLog
);
223 extern void GLAPIENTRY
224 _mesa_GetShaderiv(GLuint shader
, GLenum pname
, GLint
*params
);
226 extern void GLAPIENTRY
227 _mesa_GetShaderInfoLog(GLuint shader
, GLsizei bufSize
,
228 GLsizei
*length
, GLchar
*infoLog
);
231 extern void GLAPIENTRY
232 _mesa_GetShaderPrecisionFormat(GLenum shadertype
, GLenum precisiontype
,
233 GLint
*range
, GLint
*precision
);
235 extern void GLAPIENTRY
236 _mesa_ReleaseShaderCompiler(void);
238 extern void GLAPIENTRY
239 _mesa_ShaderBinary(GLint n
, const GLuint
*shaders
, GLenum binaryformat
,
240 const void* binary
, GLint length
);
242 extern void GLAPIENTRY
243 _mesa_GetProgramBinary(GLuint program
, GLsizei bufSize
, GLsizei
*length
,
244 GLenum
*binaryFormat
, GLvoid
*binary
);
246 extern void GLAPIENTRY
247 _mesa_ProgramBinary(GLuint program
, GLenum binaryFormat
,
248 const GLvoid
*binary
, GLsizei length
);
251 _mesa_ProgramParameteri_no_error(GLuint program
, GLenum pname
, GLint value
);
253 extern void GLAPIENTRY
254 _mesa_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
);
257 _mesa_use_program(struct gl_context
*ctx
, gl_shader_stage stage
,
258 struct gl_shader_program
*shProg
, struct gl_program
*prog
,
259 struct gl_pipeline_object
*shTarget
);
262 _mesa_copy_linked_program_data(const struct gl_shader_program
*src
,
263 struct gl_linked_shader
*dst_sh
);
266 _mesa_validate_shader_target(const struct gl_context
*ctx
, GLenum type
);
269 /* GL_ARB_separate_shader_objects */
270 extern GLuint GLAPIENTRY
271 _mesa_CreateShaderProgramv(GLenum type
, GLsizei count
,
272 const GLchar
* const *strings
);
274 /* GL_ARB_program_resource_query */
276 _mesa_program_resource_name(struct gl_program_resource
*res
);
279 _mesa_program_resource_array_size(struct gl_program_resource
*res
);
282 _mesa_program_resource_index(struct gl_shader_program
*shProg
,
283 struct gl_program_resource
*res
);
285 extern struct gl_program_resource
*
286 _mesa_program_resource_find_name(struct gl_shader_program
*shProg
,
287 GLenum programInterface
, const char *name
,
288 unsigned *array_index
);
290 extern struct gl_program_resource
*
291 _mesa_program_resource_find_index(struct gl_shader_program
*shProg
,
292 GLenum programInterface
, GLuint index
);
295 _mesa_get_program_resource_name(struct gl_shader_program
*shProg
,
296 GLenum programInterface
, GLuint index
,
297 GLsizei bufSize
, GLsizei
*length
,
298 GLchar
*name
, const char *caller
);
301 _mesa_program_resource_name_len(struct gl_program_resource
*res
);
304 _mesa_program_resource_location(struct gl_shader_program
*shProg
,
305 GLenum programInterface
, const char *name
);
308 _mesa_program_resource_location_index(struct gl_shader_program
*shProg
,
309 GLenum programInterface
, const char *name
);
312 _mesa_program_resource_prop(struct gl_shader_program
*shProg
,
313 struct gl_program_resource
*res
, GLuint index
,
314 const GLenum prop
, GLint
*val
, const char *caller
);
317 _mesa_get_program_resourceiv(struct gl_shader_program
*shProg
,
318 GLenum programInterface
, GLuint index
,
319 GLsizei propCount
, const GLenum
*props
,
320 GLsizei bufSize
, GLsizei
*length
,
323 /* GL_ARB_tessellation_shader */
325 _mesa_PatchParameteri_no_error(GLenum pname
, GLint value
);
327 extern void GLAPIENTRY
328 _mesa_PatchParameteri(GLenum pname
, GLint value
);
330 extern void GLAPIENTRY
331 _mesa_PatchParameterfv(GLenum pname
, const GLfloat
*values
);
333 /* GL_ARB_shader_subroutine */
335 _mesa_program_init_subroutine_defaults(struct gl_context
*ctx
,
336 struct gl_program
*prog
);
338 extern GLint GLAPIENTRY
339 _mesa_GetSubroutineUniformLocation(GLuint program
, GLenum shadertype
,
342 extern GLuint GLAPIENTRY
343 _mesa_GetSubroutineIndex(GLuint program
, GLenum shadertype
,
346 extern GLvoid GLAPIENTRY
347 _mesa_GetActiveSubroutineUniformiv(GLuint program
, GLenum shadertype
,
348 GLuint index
, GLenum pname
, GLint
*values
);
350 extern GLvoid GLAPIENTRY
351 _mesa_GetActiveSubroutineUniformName(GLuint program
, GLenum shadertype
,
352 GLuint index
, GLsizei bufsize
,
353 GLsizei
*length
, GLchar
*name
);
355 extern GLvoid GLAPIENTRY
356 _mesa_GetActiveSubroutineName(GLuint program
, GLenum shadertype
,
357 GLuint index
, GLsizei bufsize
,
358 GLsizei
*length
, GLchar
*name
);
360 extern GLvoid GLAPIENTRY
361 _mesa_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
362 const GLuint
*indices
);
364 extern GLvoid GLAPIENTRY
365 _mesa_GetUniformSubroutineuiv(GLenum shadertype
, GLint location
,
368 extern GLvoid GLAPIENTRY
369 _mesa_GetProgramStageiv(GLuint program
, GLenum shadertype
,
370 GLenum pname
, GLint
*values
);
376 #endif /* SHADERAPI_H */