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