shaderapi.h revision 848b8605
1/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 2004-2007  Brian Paul   All Rights Reserved.
5 * Copyright (C) 2010  VMware, Inc.  All Rights Reserved.
6 *
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:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
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.
24 */
25
26
27#ifndef SHADERAPI_H
28#define SHADERAPI_H
29
30
31#include "glheader.h"
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38
39struct _glapi_table;
40struct gl_context;
41struct gl_shader_program;
42
43extern GLbitfield
44_mesa_get_shader_flags(void);
45
46extern void
47_mesa_copy_string(GLchar *dst, GLsizei maxLength,
48                  GLsizei *length, const GLchar *src);
49
50extern void
51_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
52
53extern void
54_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
55		     const char *caller);
56
57extern unsigned
58_mesa_count_active_attribs(struct gl_shader_program *shProg);
59
60extern size_t
61_mesa_longest_attribute_name_length(struct gl_shader_program *shProg);
62
63extern void GLAPIENTRY
64_mesa_AttachObjectARB(GLhandleARB, GLhandleARB);
65
66extern void  GLAPIENTRY
67_mesa_CompileShader(GLhandleARB);
68
69extern GLhandleARB GLAPIENTRY
70_mesa_CreateProgramObjectARB(void);
71
72extern GLhandleARB GLAPIENTRY
73_mesa_CreateShaderObjectARB(GLenum type);
74
75extern void GLAPIENTRY
76_mesa_DeleteObjectARB(GLhandleARB obj);
77
78extern void GLAPIENTRY
79_mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
80
81extern void GLAPIENTRY
82_mesa_GetAttachedObjectsARB(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
83
84extern GLint GLAPIENTRY
85_mesa_GetFragDataLocation(GLuint program, const GLchar *name);
86
87extern GLint GLAPIENTRY
88_mesa_GetFragDataIndex(GLuint program, const GLchar *name);
89
90extern GLhandleARB GLAPIENTRY
91_mesa_GetHandleARB(GLenum pname);
92
93extern void GLAPIENTRY
94_mesa_GetInfoLogARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
95
96extern void GLAPIENTRY
97_mesa_GetObjectParameterfvARB(GLhandleARB, GLenum, GLfloat *);
98
99extern void GLAPIENTRY
100_mesa_GetObjectParameterivARB(GLhandleARB, GLenum, GLint *);
101
102extern void GLAPIENTRY
103_mesa_GetShaderSource(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
104
105extern GLboolean GLAPIENTRY
106_mesa_IsProgram(GLuint name);
107
108extern GLboolean GLAPIENTRY
109_mesa_IsShader(GLuint name);
110
111extern void GLAPIENTRY
112_mesa_LinkProgram(GLhandleARB programObj);
113
114extern void GLAPIENTRY
115_mesa_ShaderSource(GLhandleARB, GLsizei, const GLcharARB* const *, const GLint *);
116
117extern void GLAPIENTRY
118_mesa_UseProgram(GLhandleARB);
119
120extern void GLAPIENTRY
121_mesa_ValidateProgram(GLhandleARB);
122
123
124extern void GLAPIENTRY
125_mesa_BindAttribLocation(GLhandleARB, GLuint, const GLcharARB *);
126
127extern void GLAPIENTRY
128_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
129                           const GLchar *name);
130
131extern void GLAPIENTRY
132_mesa_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber,
133                                  GLuint index, const GLchar *name);
134
135extern void GLAPIENTRY
136_mesa_GetActiveAttrib(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
137                         GLenum *, GLcharARB *);
138
139extern GLint GLAPIENTRY
140_mesa_GetAttribLocation(GLhandleARB, const GLcharARB *);
141
142
143
144extern void GLAPIENTRY
145_mesa_AttachShader(GLuint program, GLuint shader);
146
147extern GLuint GLAPIENTRY
148_mesa_CreateShader(GLenum);
149
150extern GLuint GLAPIENTRY
151_mesa_CreateProgram(void);
152
153extern void GLAPIENTRY
154_mesa_DeleteProgram(GLuint program);
155
156extern void GLAPIENTRY
157_mesa_DeleteShader(GLuint shader);
158
159extern void GLAPIENTRY
160_mesa_DetachShader(GLuint program, GLuint shader);
161
162extern void GLAPIENTRY
163_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
164                         GLsizei *count, GLuint *obj);
165
166extern void GLAPIENTRY
167_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
168
169extern void GLAPIENTRY
170_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
171                        GLsizei *length, GLchar *infoLog);
172
173extern void GLAPIENTRY
174_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
175
176extern void GLAPIENTRY
177_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
178                       GLsizei *length, GLchar *infoLog);
179
180
181extern void GLAPIENTRY
182_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
183                               GLint *range, GLint *precision);
184
185extern void GLAPIENTRY
186_mesa_ReleaseShaderCompiler(void);
187
188extern void GLAPIENTRY
189_mesa_ShaderBinary(GLint n, const GLuint *shaders, GLenum binaryformat,
190                   const void* binary, GLint length);
191
192extern void GLAPIENTRY
193_mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length,
194                       GLenum *binaryFormat, GLvoid *binary);
195
196extern void GLAPIENTRY
197_mesa_ProgramBinary(GLuint program, GLenum binaryFormat,
198                    const GLvoid *binary, GLsizei length);
199
200extern void GLAPIENTRY
201_mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value);
202
203void
204_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
205                         struct gl_shader_program *shProg,
206                         struct gl_pipeline_object *shTarget);
207
208extern void GLAPIENTRY
209_mesa_UseShaderProgramEXT(GLenum type, GLuint program);
210
211extern void GLAPIENTRY
212_mesa_ActiveProgramEXT(GLuint program);
213
214extern GLuint GLAPIENTRY
215_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
216
217extern void
218_mesa_copy_linked_program_data(gl_shader_stage type,
219                               const struct gl_shader_program *src,
220                               struct gl_program *dst);
221
222extern bool
223_mesa_validate_shader_target(const struct gl_context *ctx, GLenum type);
224
225
226/* GL_ARB_separate_shader_objects */
227extern GLuint GLAPIENTRY
228_mesa_CreateShaderProgramv(GLenum type, GLsizei count,
229                           const GLchar* const *strings);
230
231#ifdef __cplusplus
232}
233#endif
234
235#endif /* SHADERAPI_H */
236