blob: 16ed1a0c108a1a4b9cd40447c056750efa23b9b9 [file] [log] [blame]
Brian34ae99d2006-12-18 08:28:54 -07001/*
2 * Mesa 3-D graphics library
3 * Version: 6.5
4 *
5 * Copyright (C) 2004-2006 Brian Paul 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 * BRIAN PAUL 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 SHADER_API_H
27#define SHADER_API_H
28
29
30#include "glheader.h"
31#include "mtypes.h"
32
33
Brian5b01c5e2006-12-19 18:02:03 -070034/**
35 * Internal functions
36 */
37
38extern void
39_mesa_init_shader_state(GLcontext * ctx);
40
Brian935f93f2007-03-24 16:20:02 -060041extern void
42_mesa_free_shader_state(GLcontext *ctx);
43
Brian65a18442006-12-19 18:46:56 -070044extern struct gl_shader_program *
45_mesa_new_shader_program(GLcontext *ctx, GLuint name);
Brian34ae99d2006-12-18 08:28:54 -070046
47extern void
Brian65a18442006-12-19 18:46:56 -070048_mesa_free_shader_program_data(GLcontext *ctx,
49 struct gl_shader_program *shProg);
Brian34ae99d2006-12-18 08:28:54 -070050
51extern void
Brian9e4bae92006-12-20 09:27:42 -070052_mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg);
Brian34ae99d2006-12-18 08:28:54 -070053
Brian65a18442006-12-19 18:46:56 -070054extern struct gl_shader_program *
55_mesa_lookup_shader_program(GLcontext *ctx, GLuint name);
Brian34ae99d2006-12-18 08:28:54 -070056
57
58extern struct gl_shader *
59_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
60
Brian9e4bae92006-12-20 09:27:42 -070061extern void
62_mesa_free_shader(GLcontext *ctx, struct gl_shader *sh);
63
Brian65a18442006-12-19 18:46:56 -070064extern struct gl_shader *
Brian34ae99d2006-12-18 08:28:54 -070065_mesa_lookup_shader(GLcontext *ctx, GLuint name);
66
67
Brian5b01c5e2006-12-19 18:02:03 -070068/**
69 * API/Driver functions
70 */
71
72extern void
73_mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader);
74
75extern void
76_mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
77 const GLchar *name);
78
79extern void
80_mesa_compile_shader(GLcontext *ctx, GLuint shaderObj);
81
82extern GLuint
83_mesa_create_shader(GLcontext *ctx, GLenum type);
84
85extern GLuint
86_mesa_create_program(GLcontext *ctx);
87
88extern void
89_mesa_delete_program2(GLcontext *ctx, GLuint name);
90
91extern void
92_mesa_delete_shader(GLcontext *ctx, GLuint shader);
93
94extern void
95_mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader);
96
97extern void
98_mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index,
99 GLsizei maxLength, GLsizei *length, GLint *size,
100 GLenum *type, GLchar *name);
101
102extern void
103_mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
104 GLsizei maxLength, GLsizei *length, GLint *size,
105 GLenum *type, GLchar *name);
106
107extern void
108_mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount,
109 GLsizei *count, GLuint *obj);
110
111extern GLint
112_mesa_get_attrib_location(GLcontext *ctx, GLuint program,
113 const GLchar *name);
114
115extern GLuint
116_mesa_get_handle(GLcontext *ctx, GLenum pname);
117
118extern void
119_mesa_get_programiv(GLcontext *ctx, GLuint program,
120 GLenum pname, GLint *params);
121
122extern void
123_mesa_get_program_info_log(GLcontext *ctx, GLuint program, GLsizei bufSize,
124 GLsizei *length, GLchar *infoLog);
125
126extern void
127_mesa_get_shaderiv(GLcontext *ctx, GLuint shader, GLenum pname, GLint *params);
128
129extern void
130_mesa_get_shader_info_log(GLcontext *ctx, GLuint shader, GLsizei bufSize,
131 GLsizei *length, GLchar *infoLog);
132
133extern void
134_mesa_get_shader_source(GLcontext *ctx, GLuint shader, GLsizei maxLength,
135 GLsizei *length, GLchar *sourceOut);
136
137extern void
138_mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
139 GLfloat *params);
140
141extern GLint
142_mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name);
143
144extern GLboolean
145_mesa_is_program(GLcontext *ctx, GLuint name);
146
147extern GLboolean
148_mesa_is_shader(GLcontext *ctx, GLuint name);
149
150extern void
151_mesa_link_program(GLcontext *ctx, GLuint program);
152
153extern void
154_mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source);
155
156extern void
157_mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
158 const GLvoid *values, GLenum type);
159
160void
161_mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
162 GLenum matrixType, GLint location, GLsizei count,
163 GLboolean transpose, const GLfloat *values);
164
165extern void
166_mesa_use_program(GLcontext *ctx, GLuint program);
167
168extern void
169_mesa_validate_program(GLcontext *ctx, GLuint program);
Brian34ae99d2006-12-18 08:28:54 -0700170
171
172#endif /* SHADER_API_H */