Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Brian | 5b01c5e | 2006-12-19 18:02:03 -0700 | [diff] [blame] | 34 | /** |
| 35 | * Internal functions |
| 36 | */ |
| 37 | |
| 38 | extern void |
| 39 | _mesa_init_shader_state(GLcontext * ctx); |
| 40 | |
Brian | 935f93f | 2007-03-24 16:20:02 -0600 | [diff] [blame] | 41 | extern void |
| 42 | _mesa_free_shader_state(GLcontext *ctx); |
| 43 | |
Brian | 65a1844 | 2006-12-19 18:46:56 -0700 | [diff] [blame] | 44 | extern struct gl_shader_program * |
| 45 | _mesa_new_shader_program(GLcontext *ctx, GLuint name); |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 46 | |
| 47 | extern void |
Brian | 65a1844 | 2006-12-19 18:46:56 -0700 | [diff] [blame] | 48 | _mesa_free_shader_program_data(GLcontext *ctx, |
| 49 | struct gl_shader_program *shProg); |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 50 | |
| 51 | extern void |
Brian | 9e4bae9 | 2006-12-20 09:27:42 -0700 | [diff] [blame] | 52 | _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg); |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 53 | |
Brian | 65a1844 | 2006-12-19 18:46:56 -0700 | [diff] [blame] | 54 | extern struct gl_shader_program * |
| 55 | _mesa_lookup_shader_program(GLcontext *ctx, GLuint name); |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 56 | |
| 57 | |
| 58 | extern struct gl_shader * |
| 59 | _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); |
| 60 | |
Brian | 9e4bae9 | 2006-12-20 09:27:42 -0700 | [diff] [blame] | 61 | extern void |
| 62 | _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh); |
| 63 | |
Brian | 65a1844 | 2006-12-19 18:46:56 -0700 | [diff] [blame] | 64 | extern struct gl_shader * |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 65 | _mesa_lookup_shader(GLcontext *ctx, GLuint name); |
| 66 | |
| 67 | |
Brian | 5b01c5e | 2006-12-19 18:02:03 -0700 | [diff] [blame] | 68 | /** |
| 69 | * API/Driver functions |
| 70 | */ |
| 71 | |
| 72 | extern void |
| 73 | _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader); |
| 74 | |
| 75 | extern void |
| 76 | _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index, |
| 77 | const GLchar *name); |
| 78 | |
| 79 | extern void |
| 80 | _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj); |
| 81 | |
| 82 | extern GLuint |
| 83 | _mesa_create_shader(GLcontext *ctx, GLenum type); |
| 84 | |
| 85 | extern GLuint |
| 86 | _mesa_create_program(GLcontext *ctx); |
| 87 | |
| 88 | extern void |
| 89 | _mesa_delete_program2(GLcontext *ctx, GLuint name); |
| 90 | |
| 91 | extern void |
| 92 | _mesa_delete_shader(GLcontext *ctx, GLuint shader); |
| 93 | |
| 94 | extern void |
| 95 | _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader); |
| 96 | |
| 97 | extern 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 | |
| 102 | extern 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 | |
| 107 | extern void |
| 108 | _mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount, |
| 109 | GLsizei *count, GLuint *obj); |
| 110 | |
| 111 | extern GLint |
| 112 | _mesa_get_attrib_location(GLcontext *ctx, GLuint program, |
| 113 | const GLchar *name); |
| 114 | |
| 115 | extern GLuint |
| 116 | _mesa_get_handle(GLcontext *ctx, GLenum pname); |
| 117 | |
| 118 | extern void |
| 119 | _mesa_get_programiv(GLcontext *ctx, GLuint program, |
| 120 | GLenum pname, GLint *params); |
| 121 | |
| 122 | extern void |
| 123 | _mesa_get_program_info_log(GLcontext *ctx, GLuint program, GLsizei bufSize, |
| 124 | GLsizei *length, GLchar *infoLog); |
| 125 | |
| 126 | extern void |
| 127 | _mesa_get_shaderiv(GLcontext *ctx, GLuint shader, GLenum pname, GLint *params); |
| 128 | |
| 129 | extern void |
| 130 | _mesa_get_shader_info_log(GLcontext *ctx, GLuint shader, GLsizei bufSize, |
| 131 | GLsizei *length, GLchar *infoLog); |
| 132 | |
| 133 | extern void |
| 134 | _mesa_get_shader_source(GLcontext *ctx, GLuint shader, GLsizei maxLength, |
| 135 | GLsizei *length, GLchar *sourceOut); |
| 136 | |
| 137 | extern void |
| 138 | _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location, |
| 139 | GLfloat *params); |
| 140 | |
| 141 | extern GLint |
| 142 | _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name); |
| 143 | |
| 144 | extern GLboolean |
| 145 | _mesa_is_program(GLcontext *ctx, GLuint name); |
| 146 | |
| 147 | extern GLboolean |
| 148 | _mesa_is_shader(GLcontext *ctx, GLuint name); |
| 149 | |
| 150 | extern void |
| 151 | _mesa_link_program(GLcontext *ctx, GLuint program); |
| 152 | |
| 153 | extern void |
| 154 | _mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source); |
| 155 | |
| 156 | extern void |
| 157 | _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, |
| 158 | const GLvoid *values, GLenum type); |
| 159 | |
| 160 | void |
| 161 | _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, |
| 162 | GLenum matrixType, GLint location, GLsizei count, |
| 163 | GLboolean transpose, const GLfloat *values); |
| 164 | |
| 165 | extern void |
| 166 | _mesa_use_program(GLcontext *ctx, GLuint program); |
| 167 | |
| 168 | extern void |
| 169 | _mesa_validate_program(GLcontext *ctx, GLuint program); |
Brian | 34ae99d | 2006-12-18 08:28:54 -0700 | [diff] [blame] | 170 | |
| 171 | |
| 172 | #endif /* SHADER_API_H */ |