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 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.
23 */
24
25
26#ifndef SHADERAPI_H
27#define SHADERAPI_H
28
29
30#include "glheader.h"
31
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37
38struct _glapi_table;
39struct gl_context;
40struct gl_shader_program;
41
42extern void
43_mesa_copy_string(GLchar *dst, GLsizei maxLength,
44                  GLsizei *length, const GLchar *src);
45
46extern void
47_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
48
49extern void
50_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
51		     const char *caller);
52
53extern void
54_mesa_init_shader_dispatch(const struct gl_context *ctx,
55                           struct _glapi_table *exec);
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_CompileShaderARB(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_GetShaderSourceARB(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_LinkProgramARB(GLhandleARB programObj);
113
114extern void GLAPIENTRY
115_mesa_ShaderSourceARB(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
116
117extern void GLAPIENTRY
118_mesa_UseProgramObjectARB(GLhandleARB);
119
120extern void GLAPIENTRY
121_mesa_ValidateProgramARB(GLhandleARB);
122
123
124extern void GLAPIENTRY
125_mesa_BindAttribLocationARB(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_GetActiveAttribARB(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
137                         GLenum *, GLcharARB *);
138
139extern GLint GLAPIENTRY
140_mesa_GetAttribLocationARB(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_ProgramParameteriARB(GLuint program, GLenum pname,
194                           GLint value);
195void
196_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
197			 struct gl_shader_program *shProg);
198
199extern void GLAPIENTRY
200_mesa_UseShaderProgramEXT(GLenum type, GLuint program);
201
202extern void GLAPIENTRY
203_mesa_ActiveProgramEXT(GLuint program);
204
205extern GLuint GLAPIENTRY
206_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
207
208
209#ifdef __cplusplus
210}
211#endif
212
213#endif /* SHADERAPI_H */
214