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.
39 _mesa_init_shader_state(GLcontext
* ctx
);
42 _mesa_free_shader_state(GLcontext
*ctx
);
44 extern struct gl_shader_program
*
45 _mesa_new_shader_program(GLcontext
*ctx
, GLuint name
);
48 _mesa_clear_shader_program_data(GLcontext
*ctx
,
49 struct gl_shader_program
*shProg
);
52 _mesa_free_shader_program_data(GLcontext
*ctx
,
53 struct gl_shader_program
*shProg
);
56 _mesa_free_shader_program(GLcontext
*ctx
, struct gl_shader_program
*shProg
);
59 _mesa_reference_shader_program(GLcontext
*ctx
,
60 struct gl_shader_program
**ptr
,
61 struct gl_shader_program
*shProg
);
63 extern struct gl_shader_program
*
64 _mesa_lookup_shader_program(GLcontext
*ctx
, GLuint name
);
67 extern struct gl_shader
*
68 _mesa_new_shader(GLcontext
*ctx
, GLuint name
, GLenum type
);
71 _mesa_free_shader(GLcontext
*ctx
, struct gl_shader
*sh
);
74 _mesa_reference_shader(GLcontext
*ctx
, struct gl_shader
**ptr
,
75 struct gl_shader
*sh
);
77 extern struct gl_shader
*
78 _mesa_lookup_shader(GLcontext
*ctx
, GLuint name
);
82 * API/Driver functions
86 _mesa_attach_shader(GLcontext
*ctx
, GLuint program
, GLuint shader
);
89 _mesa_bind_attrib_location(GLcontext
*ctx
, GLuint program
, GLuint index
,
93 _mesa_compile_shader(GLcontext
*ctx
, GLuint shaderObj
);
96 _mesa_create_shader(GLcontext
*ctx
, GLenum type
);
99 _mesa_create_program(GLcontext
*ctx
);
102 _mesa_delete_program2(GLcontext
*ctx
, GLuint name
);
105 _mesa_delete_shader(GLcontext
*ctx
, GLuint shader
);
108 _mesa_detach_shader(GLcontext
*ctx
, GLuint program
, GLuint shader
);
111 _mesa_get_active_attrib(GLcontext
*ctx
, GLuint program
, GLuint index
,
112 GLsizei maxLength
, GLsizei
*length
, GLint
*size
,
113 GLenum
*type
, GLchar
*name
);
116 _mesa_get_active_uniform(GLcontext
*ctx
, GLuint program
, GLuint index
,
117 GLsizei maxLength
, GLsizei
*length
, GLint
*size
,
118 GLenum
*type
, GLchar
*name
);
121 _mesa_get_attached_shaders(GLcontext
*ctx
, GLuint program
, GLsizei maxCount
,
122 GLsizei
*count
, GLuint
*obj
);
125 _mesa_get_attrib_location(GLcontext
*ctx
, GLuint program
,
129 _mesa_get_handle(GLcontext
*ctx
, GLenum pname
);
132 _mesa_get_programiv(GLcontext
*ctx
, GLuint program
,
133 GLenum pname
, GLint
*params
);
136 _mesa_get_program_info_log(GLcontext
*ctx
, GLuint program
, GLsizei bufSize
,
137 GLsizei
*length
, GLchar
*infoLog
);
140 _mesa_get_shaderiv(GLcontext
*ctx
, GLuint shader
, GLenum pname
, GLint
*params
);
143 _mesa_get_shader_info_log(GLcontext
*ctx
, GLuint shader
, GLsizei bufSize
,
144 GLsizei
*length
, GLchar
*infoLog
);
147 _mesa_get_shader_source(GLcontext
*ctx
, GLuint shader
, GLsizei maxLength
,
148 GLsizei
*length
, GLchar
*sourceOut
);
151 _mesa_get_uniformfv(GLcontext
*ctx
, GLuint program
, GLint location
,
155 _mesa_get_uniform_location(GLcontext
*ctx
, GLuint program
, const GLchar
*name
);
158 _mesa_is_program(GLcontext
*ctx
, GLuint name
);
161 _mesa_is_shader(GLcontext
*ctx
, GLuint name
);
164 _mesa_link_program(GLcontext
*ctx
, GLuint program
);
167 _mesa_shader_source(GLcontext
*ctx
, GLuint shader
, const GLchar
*source
);
170 _mesa_uniform(GLcontext
*ctx
, GLint location
, GLsizei count
,
171 const GLvoid
*values
, GLenum type
);
174 _mesa_uniform_matrix(GLcontext
*ctx
, GLint cols
, GLint rows
,
175 GLenum matrixType
, GLint location
, GLsizei count
,
176 GLboolean transpose
, const GLfloat
*values
);
179 _mesa_use_program(GLcontext
*ctx
, GLuint program
);
182 _mesa_validate_program(GLcontext
*ctx
, GLuint program
);
185 #endif /* SHADER_API_H */