diff options
Diffstat (limited to 'src/mesa/main/shaderobj.h')
-rw-r--r-- | src/mesa/main/shaderobj.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h index cbe7ae7b068..346a5b75175 100644 --- a/src/mesa/main/shaderobj.h +++ b/src/mesa/main/shaderobj.h @@ -27,6 +27,7 @@ #define SHADEROBJ_H +#include "main/compiler.h" #include "main/glheader.h" #include "main/mtypes.h" #include "program/ir_to_mesa.h" @@ -39,50 +40,50 @@ extern "C" { */ extern void -_mesa_init_shader_state(GLcontext * ctx); +_mesa_init_shader_state(struct gl_context * ctx); extern void -_mesa_free_shader_state(GLcontext *ctx); +_mesa_free_shader_state(struct gl_context *ctx); extern void -_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, +_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, struct gl_shader *sh); extern struct gl_shader * -_mesa_lookup_shader(GLcontext *ctx, GLuint name); +_mesa_lookup_shader(struct gl_context *ctx, GLuint name); extern struct gl_shader * -_mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller); +_mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller); extern void -_mesa_reference_shader_program(GLcontext *ctx, +_mesa_reference_shader_program(struct gl_context *ctx, struct gl_shader_program **ptr, struct gl_shader_program *shProg); extern void -_mesa_init_shader(GLcontext *ctx, struct gl_shader *shader); +_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader); extern struct gl_shader * -_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); +_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); extern void -_mesa_init_shader_program(GLcontext *ctx, struct gl_shader_program *prog); +_mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog); extern struct gl_shader_program * -_mesa_lookup_shader_program(GLcontext *ctx, GLuint name); +_mesa_lookup_shader_program(struct gl_context *ctx, GLuint name); extern struct gl_shader_program * -_mesa_lookup_shader_program_err(GLcontext *ctx, GLuint name, +_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name, const char *caller); extern void -_mesa_clear_shader_program_data(GLcontext *ctx, +_mesa_clear_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg); extern void -_mesa_free_shader_program_data(GLcontext *ctx, +_mesa_free_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg); @@ -91,16 +92,16 @@ extern void _mesa_init_shader_object_functions(struct dd_function_table *driver); extern void -_mesa_init_shader_state(GLcontext *ctx); +_mesa_init_shader_state(struct gl_context *ctx); extern void -_mesa_free_shader_state(GLcontext *ctx); +_mesa_free_shader_state(struct gl_context *ctx); + static INLINE GLuint _mesa_shader_type_to_index(GLenum v) { - switch(v) - { + switch (v) { case GL_VERTEX_SHADER: return MESA_SHADER_VERTEX; case GL_FRAGMENT_SHADER: @@ -108,25 +109,27 @@ _mesa_shader_type_to_index(GLenum v) case GL_GEOMETRY_SHADER: return MESA_SHADER_GEOMETRY; default: - ASSERT(0); + ASSERT(0 && "bad value in _mesa_shader_type_to_index()"); return ~0; } } + static INLINE GLenum _mesa_shader_index_to_type(GLuint i) { - GLenum enums[MESA_SHADER_TYPES] = { - GL_VERTEX_SHADER, - GL_FRAGMENT_SHADER, - GL_GEOMETRY_SHADER , + static const GLenum enums[MESA_SHADER_TYPES] = { + GL_VERTEX_SHADER, + GL_FRAGMENT_SHADER, + GL_GEOMETRY_SHADER , }; - if(i >= MESA_SHADER_TYPES) + if (i >= MESA_SHADER_TYPES) return 0; else return enums[i]; } + #ifdef __cplusplus } #endif |