blob: 2f73bb8887147ca90e65b98640264f8787737e25 [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
Brian65a18442006-12-19 18:46:56 -070041extern struct gl_shader_program *
42_mesa_new_shader_program(GLcontext *ctx, GLuint name);
Brian34ae99d2006-12-18 08:28:54 -070043
44extern void
Brian65a18442006-12-19 18:46:56 -070045_mesa_free_shader_program_data(GLcontext *ctx,
46 struct gl_shader_program *shProg);
Brian34ae99d2006-12-18 08:28:54 -070047
48extern void
Brian65a18442006-12-19 18:46:56 -070049_mesa_delete_shader_program(GLcontext *ctx, struct gl_shader_program *shProg);
Brian34ae99d2006-12-18 08:28:54 -070050
Brian65a18442006-12-19 18:46:56 -070051extern struct gl_shader_program *
52_mesa_lookup_shader_program(GLcontext *ctx, GLuint name);
Brian34ae99d2006-12-18 08:28:54 -070053
54
55extern struct gl_shader *
56_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
57
Brian65a18442006-12-19 18:46:56 -070058extern struct gl_shader *
Brian34ae99d2006-12-18 08:28:54 -070059_mesa_lookup_shader(GLcontext *ctx, GLuint name);
60
61
Brian5b01c5e2006-12-19 18:02:03 -070062/**
63 * API/Driver functions
64 */
65
66extern void
67_mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader);
68
69extern void
70_mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
71 const GLchar *name);
72
73extern void
74_mesa_compile_shader(GLcontext *ctx, GLuint shaderObj);
75
76extern GLuint
77_mesa_create_shader(GLcontext *ctx, GLenum type);
78
79extern GLuint
80_mesa_create_program(GLcontext *ctx);
81
82extern void
83_mesa_delete_program2(GLcontext *ctx, GLuint name);
84
85extern void
86_mesa_delete_shader(GLcontext *ctx, GLuint shader);
87
88extern void
89_mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader);
90
91extern void
92_mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index,
93 GLsizei maxLength, GLsizei *length, GLint *size,
94 GLenum *type, GLchar *name);
95
96extern void
97_mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
98 GLsizei maxLength, GLsizei *length, GLint *size,
99 GLenum *type, GLchar *name);
100
101extern void
102_mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount,
103 GLsizei *count, GLuint *obj);
104
105extern GLint
106_mesa_get_attrib_location(GLcontext *ctx, GLuint program,
107 const GLchar *name);
108
109extern GLuint
110_mesa_get_handle(GLcontext *ctx, GLenum pname);
111
112extern void
113_mesa_get_programiv(GLcontext *ctx, GLuint program,
114 GLenum pname, GLint *params);
115
116extern void
117_mesa_get_program_info_log(GLcontext *ctx, GLuint program, GLsizei bufSize,
118 GLsizei *length, GLchar *infoLog);
119
120extern void
121_mesa_get_shaderiv(GLcontext *ctx, GLuint shader, GLenum pname, GLint *params);
122
123extern void
124_mesa_get_shader_info_log(GLcontext *ctx, GLuint shader, GLsizei bufSize,
125 GLsizei *length, GLchar *infoLog);
126
127extern void
128_mesa_get_shader_source(GLcontext *ctx, GLuint shader, GLsizei maxLength,
129 GLsizei *length, GLchar *sourceOut);
130
131extern void
132_mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
133 GLfloat *params);
134
135extern GLint
136_mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name);
137
138extern GLboolean
139_mesa_is_program(GLcontext *ctx, GLuint name);
140
141extern GLboolean
142_mesa_is_shader(GLcontext *ctx, GLuint name);
143
144extern void
145_mesa_link_program(GLcontext *ctx, GLuint program);
146
147extern void
148_mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source);
149
150extern void
151_mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
152 const GLvoid *values, GLenum type);
153
154void
155_mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
156 GLenum matrixType, GLint location, GLsizei count,
157 GLboolean transpose, const GLfloat *values);
158
159extern void
160_mesa_use_program(GLcontext *ctx, GLuint program);
161
162extern void
163_mesa_validate_program(GLcontext *ctx, GLuint program);
Brian34ae99d2006-12-18 08:28:54 -0700164
165
166#endif /* SHADER_API_H */