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