df78351411c6dbb0e3694e00bff6b659582630b4
[mesa.git] / src / mesa / main / shaderapi.h
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 #include "mtypes.h"
32
33
34 extern GLint
35 _mesa_sizeof_glsl_type(GLenum type);
36
37 extern void
38 _mesa_copy_string(GLchar *dst, GLsizei maxLength,
39 GLsizei *length, const GLchar *src);
40
41 extern void
42 _mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
43
44 extern void
45 _mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
46 const char *caller);
47
48 extern void
49 _mesa_init_shader_dispatch(struct _glapi_table *exec);
50
51
52
53 extern void GLAPIENTRY
54 _mesa_AttachObjectARB(GLhandleARB, GLhandleARB);
55
56 extern void GLAPIENTRY
57 _mesa_CompileShaderARB(GLhandleARB);
58
59 extern GLhandleARB GLAPIENTRY
60 _mesa_CreateProgramObjectARB(void);
61
62 extern GLhandleARB GLAPIENTRY
63 _mesa_CreateShaderObjectARB(GLenum type);
64
65 extern void GLAPIENTRY
66 _mesa_DeleteObjectARB(GLhandleARB obj);
67
68 extern void GLAPIENTRY
69 _mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
70
71 extern void GLAPIENTRY
72 _mesa_GetAttachedObjectsARB(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
73
74 extern GLint GLAPIENTRY
75 _mesa_GetFragDataLocation(GLuint program, const GLchar *name);
76
77 extern GLhandleARB GLAPIENTRY
78 _mesa_GetHandleARB(GLenum pname);
79
80 extern void GLAPIENTRY
81 _mesa_GetInfoLogARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
82
83 extern void GLAPIENTRY
84 _mesa_GetObjectParameterfvARB(GLhandleARB, GLenum, GLfloat *);
85
86 extern void GLAPIENTRY
87 _mesa_GetObjectParameterivARB(GLhandleARB, GLenum, GLint *);
88
89 extern void GLAPIENTRY
90 _mesa_GetShaderSourceARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
91
92 extern GLboolean GLAPIENTRY
93 _mesa_IsProgram(GLuint name);
94
95 extern GLboolean GLAPIENTRY
96 _mesa_IsShader(GLuint name);
97
98 extern void GLAPIENTRY
99 _mesa_LinkProgramARB(GLhandleARB programObj);
100
101 extern void GLAPIENTRY
102 _mesa_ShaderSourceARB(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
103
104 extern void GLAPIENTRY
105 _mesa_UseProgramObjectARB(GLhandleARB);
106
107 extern void GLAPIENTRY
108 _mesa_ValidateProgramARB(GLhandleARB);
109
110
111 extern void GLAPIENTRY
112 _mesa_BindAttribLocationARB(GLhandleARB, GLuint, const GLcharARB *);
113
114 extern void GLAPIENTRY
115 _mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
116 const GLchar *name);
117
118 extern void GLAPIENTRY
119 _mesa_GetActiveAttribARB(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
120 GLenum *, GLcharARB *);
121
122 extern GLint GLAPIENTRY
123 _mesa_GetAttribLocationARB(GLhandleARB, const GLcharARB *);
124
125
126
127 extern void GLAPIENTRY
128 _mesa_AttachShader(GLuint program, GLuint shader);
129
130 extern GLuint GLAPIENTRY
131 _mesa_CreateShader(GLenum);
132
133 extern GLuint GLAPIENTRY
134 _mesa_CreateProgram(void);
135
136 extern void GLAPIENTRY
137 _mesa_DeleteProgram(GLuint program);
138
139 extern void GLAPIENTRY
140 _mesa_DeleteShader(GLuint shader);
141
142 extern void GLAPIENTRY
143 _mesa_DetachShader(GLuint program, GLuint shader);
144
145 extern void GLAPIENTRY
146 _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
147 GLsizei *count, GLuint *obj);
148
149 extern void GLAPIENTRY
150 _mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
151
152 extern void GLAPIENTRY
153 _mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
154 GLsizei *length, GLchar *infoLog);
155
156 extern void GLAPIENTRY
157 _mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
158
159 extern void GLAPIENTRY
160 _mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
161 GLsizei *length, GLchar *infoLog);
162
163
164 extern void GLAPIENTRY
165 _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
166 GLint *range, GLint *precision);
167
168 extern void GLAPIENTRY
169 _mesa_ReleaseShaderCompiler(void);
170
171 extern void GLAPIENTRY
172 _mesa_ShaderBinary(GLint n, const GLuint *shaders, GLenum binaryformat,
173 const void* binary, GLint length);
174
175 extern void GLAPIENTRY
176 _mesa_ProgramParameteriARB(GLuint program, GLenum pname,
177 GLint value);
178 void
179 _mesa_use_shader_program(struct gl_context *ctx, GLenum type,
180 struct gl_shader_program *shProg);
181
182 extern void GLAPIENTRY
183 _mesa_UseShaderProgramEXT(GLenum type, GLuint program);
184
185 extern void GLAPIENTRY
186 _mesa_ActiveProgramEXT(GLuint program);
187
188 extern GLuint GLAPIENTRY
189 _mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
190
191 #endif /* SHADERAPI_H */