summaryrefslogtreecommitdiff
path: root/src/mesa/program
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-10-12 12:26:10 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-10-13 09:43:25 -0400
commitf9995b30756140724f41daf963fa06167912be7f (patch)
treebc34fd4db5eb9d2ad55968cb4e6e4e5a65df5a27 /src/mesa/program
parent31aca27c08d6a385c595d34fe4ee06390bf5b0e8 (diff)
Drop GLcontext typedef and use struct gl_context instead
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/arbprogparse.c4
-rw-r--r--src/mesa/program/arbprogparse.h4
-rw-r--r--src/mesa/program/ir_to_mesa.cpp16
-rw-r--r--src/mesa/program/ir_to_mesa.h8
-rw-r--r--src/mesa/program/nvfragparse.c4
-rw-r--r--src/mesa/program/nvfragparse.h2
-rw-r--r--src/mesa/program/nvvertparse.c4
-rw-r--r--src/mesa/program/nvvertparse.h2
-rw-r--r--src/mesa/program/prog_cache.c6
-rw-r--r--src/mesa/program/prog_cache.h4
-rw-r--r--src/mesa/program/prog_execute.c6
-rw-r--r--src/mesa/program/prog_execute.h8
-rw-r--r--src/mesa/program/prog_optimize.c4
-rw-r--r--src/mesa/program/prog_optimize.h2
-rw-r--r--src/mesa/program/prog_print.c4
-rw-r--r--src/mesa/program/prog_print.h2
-rw-r--r--src/mesa/program/prog_statevars.c6
-rw-r--r--src/mesa/program/prog_statevars.h4
-rw-r--r--src/mesa/program/program.c30
-rw-r--r--src/mesa/program/program.h40
-rw-r--r--src/mesa/program/program_parse.tab.c2
-rw-r--r--src/mesa/program/program_parse.y2
-rw-r--r--src/mesa/program/program_parser.h9
-rw-r--r--src/mesa/program/programopt.c12
-rw-r--r--src/mesa/program/programopt.h8
25 files changed, 95 insertions, 98 deletions
diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c
index f834aaf568..ca63e72c08 100644
--- a/src/mesa/program/arbprogparse.c
+++ b/src/mesa/program/arbprogparse.c
@@ -64,7 +64,7 @@ having three separate program parameter arrays.
void
-_mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
+_mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
const GLvoid *str, GLsizei len,
struct gl_fragment_program *program)
{
@@ -162,7 +162,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
* object unchanged.
*/
void
-_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
+_mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
const GLvoid *str, GLsizei len,
struct gl_vertex_program *program)
{
diff --git a/src/mesa/program/arbprogparse.h b/src/mesa/program/arbprogparse.h
index 980d39fb9f..08e25a1c16 100644
--- a/src/mesa/program/arbprogparse.h
+++ b/src/mesa/program/arbprogparse.h
@@ -29,12 +29,12 @@
#include "main/mtypes.h"
extern void
-_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
+_mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
const GLvoid *str, GLsizei len,
struct gl_vertex_program *program);
extern void
-_mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target,
+_mesa_parse_arb_fragment_program(struct gl_context *ctx, GLenum target,
const GLvoid *str, GLsizei len,
struct gl_fragment_program *program);
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index da0d8106df..cd609653fb 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -183,7 +183,7 @@ public:
function_entry *current_function;
- GLcontext *ctx;
+ struct gl_context *ctx;
struct gl_program *prog;
struct gl_shader_program *shader_program;
struct gl_shader_compiler_options *options;
@@ -2162,7 +2162,7 @@ add_uniforms_to_parameters_list(struct gl_shader_program *shader_program,
}
static void
-set_uniform_initializer(GLcontext *ctx, void *mem_ctx,
+set_uniform_initializer(struct gl_context *ctx, void *mem_ctx,
struct gl_shader_program *shader_program,
const char *name, const glsl_type *type,
ir_constant *val)
@@ -2232,7 +2232,7 @@ set_uniform_initializer(GLcontext *ctx, void *mem_ctx,
}
static void
-set_uniform_initializers(GLcontext *ctx,
+set_uniform_initializers(struct gl_context *ctx,
struct gl_shader_program *shader_program)
{
void *mem_ctx = NULL;
@@ -2262,7 +2262,7 @@ set_uniform_initializers(GLcontext *ctx,
* Convert a shader's GLSL IR into a Mesa gl_program.
*/
struct gl_program *
-get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
+get_mesa_program(struct gl_context *ctx, struct gl_shader_program *shader_program,
struct gl_shader *shader)
{
ir_to_mesa_visitor v;
@@ -2446,7 +2446,7 @@ extern "C" {
* XXX can we remove the ctx->Driver.CompileShader() hook?
*/
GLboolean
-_mesa_ir_compile_shader(GLcontext *ctx, struct gl_shader *shader)
+_mesa_ir_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
assert(shader->CompileStatus);
(void) ctx;
@@ -2462,7 +2462,7 @@ _mesa_ir_compile_shader(GLcontext *ctx, struct gl_shader *shader)
* code lowering and other optimizations.
*/
GLboolean
-_mesa_ir_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
+_mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
{
assert(prog->LinkStatus);
@@ -2544,7 +2544,7 @@ _mesa_ir_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
* Compile a GLSL shader. Called via glCompileShader().
*/
void
-_mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
+_mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
@@ -2632,7 +2632,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
* Link a GLSL shader program. Called via glLinkProgram().
*/
void
-_mesa_glsl_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
+_mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
{
unsigned int i;
diff --git a/src/mesa/program/ir_to_mesa.h b/src/mesa/program/ir_to_mesa.h
index ecaacde4bb..7197615f94 100644
--- a/src/mesa/program/ir_to_mesa.h
+++ b/src/mesa/program/ir_to_mesa.h
@@ -28,10 +28,10 @@ extern "C" {
#include "main/config.h"
#include "main/mtypes.h"
-void _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *sh);
-void _mesa_glsl_link_shader(GLcontext *ctx, struct gl_shader_program *prog);
-GLboolean _mesa_ir_compile_shader(GLcontext *ctx, struct gl_shader *shader);
-GLboolean _mesa_ir_link_shader(GLcontext *ctx, struct gl_shader_program *prog);
+void _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *sh);
+void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
+GLboolean _mesa_ir_compile_shader(struct gl_context *ctx, struct gl_shader *shader);
+GLboolean _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
#ifdef __cplusplus
}
diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c
index 0de3c5804d..8516b5fc1f 100644
--- a/src/mesa/program/nvfragparse.c
+++ b/src/mesa/program/nvfragparse.c
@@ -141,7 +141,7 @@ static const struct instruction_pattern Instructions[] = {
* _successfully_ parsed the program text.
*/
struct parse_state {
- GLcontext *ctx;
+ struct gl_context *ctx;
const GLubyte *start; /* start of program string */
const GLubyte *pos; /* current position */
const GLubyte *curLine;
@@ -1463,7 +1463,7 @@ Parse_InstructionSequence(struct parse_state *parseState,
* indicates the position of the error in 'str'.
*/
void
-_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
+_mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum dstTarget,
const GLubyte *str, GLsizei len,
struct gl_fragment_program *program)
{
diff --git a/src/mesa/program/nvfragparse.h b/src/mesa/program/nvfragparse.h
index e28a6c4934..3e85dd2c30 100644
--- a/src/mesa/program/nvfragparse.h
+++ b/src/mesa/program/nvfragparse.h
@@ -33,7 +33,7 @@
#include "main/mtypes.h"
extern void
-_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum target,
+_mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum target,
const GLubyte *str, GLsizei len,
struct gl_fragment_program *program);
diff --git a/src/mesa/program/nvvertparse.c b/src/mesa/program/nvvertparse.c
index 1ac83d0e59..bdd44a4513 100644
--- a/src/mesa/program/nvvertparse.c
+++ b/src/mesa/program/nvvertparse.c
@@ -54,7 +54,7 @@
* program attributes.
*/
struct parse_state {
- GLcontext *ctx;
+ struct gl_context *ctx;
const GLubyte *start;
const GLubyte *pos;
const GLubyte *curLine;
@@ -1282,7 +1282,7 @@ Parse_Program(struct parse_state *parseState,
* indicates the position of the error in 'str'.
*/
void
-_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
+_mesa_parse_nv_vertex_program(struct gl_context *ctx, GLenum dstTarget,
const GLubyte *str, GLsizei len,
struct gl_vertex_program *program)
{
diff --git a/src/mesa/program/nvvertparse.h b/src/mesa/program/nvvertparse.h
index 91ef79e6c3..e98e867320 100644
--- a/src/mesa/program/nvvertparse.h
+++ b/src/mesa/program/nvvertparse.h
@@ -32,7 +32,7 @@
#include "main/mtypes.h"
extern void
-_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum target,
+_mesa_parse_nv_vertex_program(struct gl_context *ctx, GLenum target,
const GLubyte *str, GLsizei len,
struct gl_vertex_program *program);
diff --git a/src/mesa/program/prog_cache.c b/src/mesa/program/prog_cache.c
index 8af689754b..56ca59890d 100644
--- a/src/mesa/program/prog_cache.c
+++ b/src/mesa/program/prog_cache.c
@@ -104,7 +104,7 @@ rehash(struct gl_program_cache *cache)
static void
-clear_cache(GLcontext *ctx, struct gl_program_cache *cache)
+clear_cache(struct gl_context *ctx, struct gl_program_cache *cache)
{
struct cache_item *c, *next;
GLuint i;
@@ -145,7 +145,7 @@ _mesa_new_program_cache(void)
void
-_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache)
+_mesa_delete_program_cache(struct gl_context *ctx, struct gl_program_cache *cache)
{
clear_cache(ctx, cache);
free(cache->items);
@@ -178,7 +178,7 @@ _mesa_search_program_cache(struct gl_program_cache *cache,
void
-_mesa_program_cache_insert(GLcontext *ctx,
+_mesa_program_cache_insert(struct gl_context *ctx,
struct gl_program_cache *cache,
const void *key, GLuint keysize,
struct gl_program *program)
diff --git a/src/mesa/program/prog_cache.h b/src/mesa/program/prog_cache.h
index bfe8f99d44..4907ae3030 100644
--- a/src/mesa/program/prog_cache.h
+++ b/src/mesa/program/prog_cache.h
@@ -41,7 +41,7 @@ extern struct gl_program_cache *
_mesa_new_program_cache(void);
extern void
-_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *pc);
+_mesa_delete_program_cache(struct gl_context *ctx, struct gl_program_cache *pc);
extern struct gl_program *
@@ -49,7 +49,7 @@ _mesa_search_program_cache(struct gl_program_cache *cache,
const void *key, GLuint keysize);
extern void
-_mesa_program_cache_insert(GLcontext *ctx,
+_mesa_program_cache_insert(struct gl_context *ctx,
struct gl_program_cache *cache,
const void *key, GLuint keysize,
struct gl_program *program);
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index 2ae5bc572a..1d97a077f5 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -296,7 +296,7 @@ fetch_vector4ui(const struct prog_src_register *source,
* XXX this currently only works for fragment program input attribs.
*/
static void
-fetch_vector4_deriv(GLcontext * ctx,
+fetch_vector4_deriv(struct gl_context * ctx,
const struct prog_src_register *source,
const struct gl_program_machine *machine,
char xOrY, GLfloat result[4])
@@ -380,7 +380,7 @@ fetch_vector1ui(const struct prog_src_register *source,
* Fetch texel from texture. Use partial derivatives when possible.
*/
static INLINE void
-fetch_texel(GLcontext *ctx,
+fetch_texel(struct gl_context *ctx,
const struct gl_program_machine *machine,
const struct prog_instruction *inst,
const GLfloat texcoord[4], GLfloat lodBias,
@@ -630,7 +630,7 @@ store_vector4ui(const struct prog_instruction *inst,
* \return GL_TRUE if program completed or GL_FALSE if program executed KIL.
*/
GLboolean
-_mesa_execute_program(GLcontext * ctx,
+_mesa_execute_program(struct gl_context * ctx,
const struct gl_program *program,
struct gl_program_machine *machine)
{
diff --git a/src/mesa/program/prog_execute.h b/src/mesa/program/prog_execute.h
index f59b65176f..cefd468c36 100644
--- a/src/mesa/program/prog_execute.h
+++ b/src/mesa/program/prog_execute.h
@@ -29,10 +29,10 @@
#include "main/mtypes.h"
-typedef void (*FetchTexelLodFunc)(GLcontext *ctx, const GLfloat texcoord[4],
+typedef void (*FetchTexelLodFunc)(struct gl_context *ctx, const GLfloat texcoord[4],
GLfloat lambda, GLuint unit, GLfloat color[4]);
-typedef void (*FetchTexelDerivFunc)(GLcontext *ctx, const GLfloat texcoord[4],
+typedef void (*FetchTexelDerivFunc)(struct gl_context *ctx, const GLfloat texcoord[4],
const GLfloat texdx[4],
const GLfloat texdy[4],
GLfloat lodBias,
@@ -74,11 +74,11 @@ struct gl_program_machine
extern void
-_mesa_get_program_register(GLcontext *ctx, gl_register_file file,
+_mesa_get_program_register(struct gl_context *ctx, gl_register_file file,
GLuint index, GLfloat val[4]);
extern GLboolean
-_mesa_execute_program(GLcontext *ctx,
+_mesa_execute_program(struct gl_context *ctx,
const struct gl_program *program,
struct gl_program_machine *machine);
diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
index 0dc779073d..96971f2eda 100644
--- a/src/mesa/program/prog_optimize.c
+++ b/src/mesa/program/prog_optimize.c
@@ -1216,7 +1216,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
#if 0
static void
-print_it(GLcontext *ctx, struct gl_program *program, const char *txt) {
+print_it(struct gl_context *ctx, struct gl_program *program, const char *txt) {
fprintf(stderr, "%s (%u inst):\n", txt, program->NumInstructions);
_mesa_print_program(program);
_mesa_print_program_parameters(ctx, program);
@@ -1230,7 +1230,7 @@ print_it(GLcontext *ctx, struct gl_program *program, const char *txt) {
* instructions, temp regs, etc.
*/
void
-_mesa_optimize_program(GLcontext *ctx, struct gl_program *program)
+_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program)
{
GLboolean any_change;
diff --git a/src/mesa/program/prog_optimize.h b/src/mesa/program/prog_optimize.h
index 06cd9cb2c2..00f1080449 100644
--- a/src/mesa/program/prog_optimize.h
+++ b/src/mesa/program/prog_optimize.h
@@ -41,6 +41,6 @@ _mesa_find_temp_intervals(const struct prog_instruction *instructions,
GLint intEnd[MAX_PROGRAM_TEMPS]);
extern void
-_mesa_optimize_program(GLcontext *ctx, struct gl_program *program);
+_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program);
#endif
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index 00aa6de963..79c01020eb 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -909,7 +909,7 @@ binary(GLbitfield64 val)
*/
static void
_mesa_fprint_program_parameters(FILE *f,
- GLcontext *ctx,
+ struct gl_context *ctx,
const struct gl_program *prog)
{
GLuint i;
@@ -951,7 +951,7 @@ _mesa_fprint_program_parameters(FILE *f,
* Print all of a program's parameters/fields to stderr.
*/
void
-_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
+_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog)
{
_mesa_fprint_program_parameters(stderr, ctx, prog);
}
diff --git a/src/mesa/program/prog_print.h b/src/mesa/program/prog_print.h
index 78b90aeb4d..f080b3fd2e 100644
--- a/src/mesa/program/prog_print.h
+++ b/src/mesa/program/prog_print.h
@@ -100,7 +100,7 @@ _mesa_fprint_program_opt(FILE *f,
GLboolean lineNumbers);
extern void
-_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog);
+_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog);
extern void
_mesa_print_parameter_list(const struct gl_program_parameter_list *list);
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
index c6fb42b9a6..baac29ff0d 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -46,7 +46,7 @@
* The program parser will produce the state[] values.
*/
static void
-_mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
+_mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
GLfloat *value)
{
switch (state[0]) {
@@ -1049,7 +1049,7 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
* This would be called at glBegin time when using a fragment program.
*/
void
-_mesa_load_state_parameters(GLcontext *ctx,
+_mesa_load_state_parameters(struct gl_context *ctx,
struct gl_program_parameter_list *paramList)
{
GLuint i;
@@ -1103,7 +1103,7 @@ load_transpose_matrix(GLfloat registers[][4], GLuint pos,
* glBegin/glEnd, not per-vertex.
*/
void
-_mesa_load_tracked_matrices(GLcontext *ctx)
+_mesa_load_tracked_matrices(struct gl_context *ctx)
{
GLuint i;
diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h
index cfce226fb4..6e5be53630 100644
--- a/src/mesa/program/prog_statevars.h
+++ b/src/mesa/program/prog_statevars.h
@@ -125,7 +125,7 @@ typedef enum gl_state_index_ {
extern void
-_mesa_load_state_parameters(GLcontext *ctx,
+_mesa_load_state_parameters(struct gl_context *ctx,
struct gl_program_parameter_list *paramList);
@@ -138,7 +138,7 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
extern void
-_mesa_load_tracked_matrices(GLcontext *ctx);
+_mesa_load_tracked_matrices(struct gl_context *ctx);
#endif /* PROG_STATEVARS_H */
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 06b9539bda..cdcf4ec265 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -49,7 +49,7 @@ struct gl_program _mesa_DummyProgram;
* Init context's vertex/fragment program state
*/
void
-_mesa_init_program(GLcontext *ctx)
+_mesa_init_program(struct gl_context *ctx)
{
GLuint i;
@@ -128,7 +128,7 @@ _mesa_init_program(GLcontext *ctx)
* Free a context's vertex/fragment program state
*/
void
-_mesa_free_program_data(GLcontext *ctx)
+_mesa_free_program_data(struct gl_context *ctx)
{
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
@@ -161,7 +161,7 @@ _mesa_free_program_data(GLcontext *ctx)
* shared state.
*/
void
-_mesa_update_default_objects_program(GLcontext *ctx)
+_mesa_update_default_objects_program(struct gl_context *ctx)
{
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
@@ -203,7 +203,7 @@ _mesa_update_default_objects_program(GLcontext *ctx)
* This is generally called from within the parsers.
*/
void
-_mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string)
+_mesa_set_program_error(struct gl_context *ctx, GLint pos, const char *string)
{
ctx->Program.ErrorPos = pos;
free((void *) ctx->Program.ErrorString);
@@ -260,7 +260,7 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
* Initialize a new vertex/fragment program object.
*/
static struct gl_program *
-_mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
+_mesa_init_program_struct( struct gl_context *ctx, struct gl_program *prog,
GLenum target, GLuint id)
{
(void) ctx;
@@ -286,7 +286,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
* Initialize a new fragment program object.
*/
struct gl_program *
-_mesa_init_fragment_program( GLcontext *ctx, struct gl_fragment_program *prog,
+_mesa_init_fragment_program( struct gl_context *ctx, struct gl_fragment_program *prog,
GLenum target, GLuint id)
{
if (prog)
@@ -300,7 +300,7 @@ _mesa_init_fragment_program( GLcontext *ctx, struct gl_fragment_program *prog,
* Initialize a new vertex program object.
*/
struct gl_program *
-_mesa_init_vertex_program( GLcontext *ctx, struct gl_vertex_program *prog,
+_mesa_init_vertex_program( struct gl_context *ctx, struct gl_vertex_program *prog,
GLenum target, GLuint id)
{
if (prog)
@@ -314,7 +314,7 @@ _mesa_init_vertex_program( GLcontext *ctx, struct gl_vertex_program *prog,
* Initialize a new geometry program object.
*/
struct gl_program *
-_mesa_init_geometry_program( GLcontext *ctx, struct gl_geometry_program *prog,
+_mesa_init_geometry_program( struct gl_context *ctx, struct gl_geometry_program *prog,
GLenum target, GLuint id)
{
if (prog)
@@ -337,7 +337,7 @@ _mesa_init_geometry_program( GLcontext *ctx, struct gl_geometry_program *prog,
* \return pointer to new program object
*/
struct gl_program *
-_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id)
+_mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id)
{
struct gl_program *prog;
switch (target) {
@@ -372,7 +372,7 @@ _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id)
* by a device driver function.
*/
void
-_mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
+_mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
{
(void) ctx;
ASSERT(prog);
@@ -406,7 +406,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
* casts elsewhere.
*/
struct gl_program *
-_mesa_lookup_program(GLcontext *ctx, GLuint id)
+_mesa_lookup_program(struct gl_context *ctx, GLuint id)
{
if (id)
return (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
@@ -419,7 +419,7 @@ _mesa_lookup_program(GLcontext *ctx, GLuint id)
* Reference counting for vertex/fragment programs
*/
void
-_mesa_reference_program(GLcontext *ctx,
+_mesa_reference_program(struct gl_context *ctx,
struct gl_program **ptr,
struct gl_program *prog)
{
@@ -486,7 +486,7 @@ _mesa_reference_program(GLcontext *ctx,
* made by a device driver.
*/
struct gl_program *
-_mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
+_mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
{
struct gl_program *clone;
@@ -729,7 +729,7 @@ adjust_param_indexes(struct prog_instruction *inst, GLuint numInst,
* the first program go to the inputs of the second program.
*/
struct gl_program *
-_mesa_combine_programs(GLcontext *ctx,
+_mesa_combine_programs(struct gl_context *ctx,
const struct gl_program *progA,
const struct gl_program *progB)
{
@@ -923,7 +923,7 @@ _mesa_find_free_register(const GLboolean used[],
* behaviour.
*/
void
-_mesa_postprocess_program(GLcontext *ctx, struct gl_program *prog)
+_mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog)
{
static const GLfloat white[4] = { 0.5, 0.5, 0.5, 0.5 };
GLuint i;
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 03b1066f32..70cc2c3aae 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -48,16 +48,16 @@ extern struct gl_program _mesa_DummyProgram;
extern void
-_mesa_init_program(GLcontext *ctx);
+_mesa_init_program(struct gl_context *ctx);
extern void
-_mesa_free_program_data(GLcontext *ctx);
+_mesa_free_program_data(struct gl_context *ctx);
extern void
-_mesa_update_default_objects_program(GLcontext *ctx);
+_mesa_update_default_objects_program(struct gl_context *ctx);
extern void
-_mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string);
+_mesa_set_program_error(struct gl_context *ctx, GLint pos, const char *string);
extern const GLubyte *
_mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
@@ -65,36 +65,36 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
extern struct gl_program *
-_mesa_init_vertex_program(GLcontext *ctx,
+_mesa_init_vertex_program(struct gl_context *ctx,
struct gl_vertex_program *prog,
GLenum target, GLuint id);
extern struct gl_program *
-_mesa_init_fragment_program(GLcontext *ctx,
+_mesa_init_fragment_program(struct gl_context *ctx,
struct gl_fragment_program *prog,
GLenum target, GLuint id);
extern struct gl_program *
-_mesa_init_geometry_program(GLcontext *ctx,
+_mesa_init_geometry_program(struct gl_context *ctx,
struct gl_geometry_program *prog,
GLenum target, GLuint id);
extern struct gl_program *
-_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id);
+_mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id);
extern void
-_mesa_delete_program(GLcontext *ctx, struct gl_program *prog);
+_mesa_delete_program(struct gl_context *ctx, struct gl_program *prog);
extern struct gl_program *
-_mesa_lookup_program(GLcontext *ctx, GLuint id);
+_mesa_lookup_program(struct gl_context *ctx, GLuint id);
extern void
-_mesa_reference_program(GLcontext *ctx,
+_mesa_reference_program(struct gl_context *ctx,
struct gl_program **ptr,
struct gl_program *prog);
static INLINE void
-_mesa_reference_vertprog(GLcontext *ctx,
+_mesa_reference_vertprog(struct gl_context *ctx,
struct gl_vertex_program **ptr,
struct gl_vertex_program *prog)
{
@@ -103,7 +103,7 @@ _mesa_reference_vertprog(GLcontext *ctx,
}
static INLINE void
-_mesa_reference_fragprog(GLcontext *ctx,
+_mesa_reference_fragprog(struct gl_context *ctx,
struct gl_fragment_program **ptr,
struct gl_fragment_program *prog)
{
@@ -112,7 +112,7 @@ _mesa_reference_fragprog(GLcontext *ctx,
}
static INLINE void
-_mesa_reference_geomprog(GLcontext *ctx,
+_mesa_reference_geomprog(struct gl_context *ctx,
struct gl_geometry_program **ptr,
struct gl_geometry_program *prog)
{
@@ -121,24 +121,24 @@ _mesa_reference_geomprog(GLcontext *ctx,
}
extern struct gl_program *
-_mesa_clone_program(GLcontext *ctx, const struct gl_program *prog);
+_mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog);
static INLINE struct gl_vertex_program *
-_mesa_clone_vertex_program(GLcontext *ctx,
+_mesa_clone_vertex_program(struct gl_context *ctx,
const struct gl_vertex_program *prog)
{
return (struct gl_vertex_program *) _mesa_clone_program(ctx, &prog->Base);
}
static INLINE struct gl_geometry_program *
-_mesa_clone_geometry_program(GLcontext *ctx,
+_mesa_clone_geometry_program(struct gl_context *ctx,
const struct gl_geometry_program *prog)
{
return (struct gl_geometry_program *) _mesa_clone_program(ctx, &prog->Base);
}
static INLINE struct gl_fragment_program *
-_mesa_clone_fragment_program(GLcontext *ctx,
+_mesa_clone_fragment_program(struct gl_context *ctx,
const struct gl_fragment_program *prog)
{
return (struct gl_fragment_program *) _mesa_clone_program(ctx, &prog->Base);
@@ -152,7 +152,7 @@ extern GLboolean
_mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count);
extern struct gl_program *
-_mesa_combine_programs(GLcontext *ctx,
+_mesa_combine_programs(struct gl_context *ctx,
const struct gl_program *progA,
const struct gl_program *progB);
@@ -166,7 +166,7 @@ _mesa_find_free_register(const GLboolean used[],
GLuint maxRegs, GLuint firstReg);
extern void
-_mesa_postprocess_program(GLcontext *ctx, struct gl_program *prog);
+_mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog);
/* keep these in the same order as TGSI_PROCESSOR_* */
diff --git a/src/mesa/program/program_parse.tab.c b/src/mesa/program/program_parse.tab.c
index 08ead30def..baef311d0c 100644
--- a/src/mesa/program/program_parse.tab.c
+++ b/src/mesa/program/program_parse.tab.c
@@ -5604,7 +5604,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s)
GLboolean
-_mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str,
+_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str,
GLsizei len, struct asm_parser_state *state)
{
struct asm_instruction *inst;
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index cf621ae424..784ea28c17 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -2643,7 +2643,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s)
GLboolean
-_mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str,
+_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str,
GLsizei len, struct asm_parser_state *state)
{
struct asm_instruction *inst;
diff --git a/src/mesa/program/program_parser.h b/src/mesa/program/program_parser.h
index be952d4b9c..d689eef795 100644
--- a/src/mesa/program/program_parser.h
+++ b/src/mesa/program/program_parser.h
@@ -24,10 +24,7 @@
#include "main/config.h"
-#ifndef MTYPES_H
-struct __GLcontextRec;
-typedef struct __GLcontextRec GLcontext;
-#endif
+struct gl_context;
enum asm_type {
at_none,
@@ -131,7 +128,7 @@ struct asm_instruction {
struct asm_parser_state {
- GLcontext *ctx;
+ struct gl_context *ctx;
struct gl_program *prog;
/**
@@ -237,7 +234,7 @@ typedef struct YYLTYPE {
#define YYLTYPE_IS_TRIVIAL 1
-extern GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target,
+extern GLboolean _mesa_parse_arb_program(struct gl_context *ctx, GLenum target,
const GLubyte *str, GLsizei len, struct asm_parser_state *state);
diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c
index fb2ebe6338..f92881f833 100644
--- a/src/mesa/program/programopt.c
+++ b/src/mesa/program/programopt.c
@@ -46,7 +46,7 @@
* May be used to implement the position_invariant option.
*/
static void
-_mesa_insert_mvp_dp4_code(GLcontext *ctx, struct gl_vertex_program *vprog)
+_mesa_insert_mvp_dp4_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
{
struct prog_instruction *newInst;
const GLuint origLen = vprog->Base.NumInstructions;
@@ -114,7 +114,7 @@ _mesa_insert_mvp_dp4_code(GLcontext *ctx, struct gl_vertex_program *vprog)
static void
-_mesa_insert_mvp_mad_code(GLcontext *ctx, struct gl_vertex_program *vprog)
+_mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
{
struct prog_instruction *newInst;
const GLuint origLen = vprog->Base.NumInstructions;
@@ -216,7 +216,7 @@ _mesa_insert_mvp_mad_code(GLcontext *ctx, struct gl_vertex_program *vprog)
void
-_mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog)
+_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
{
if (ctx->mvp_with_dp4)
_mesa_insert_mvp_dp4_code( ctx, vprog );
@@ -238,7 +238,7 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog)
* to vertex programs too.
*/
void
-_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
+_mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog)
{
static const gl_state_index fogPStateOpt[STATE_LENGTH]
= { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 };
@@ -585,7 +585,7 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
* This is for debug/test purposes.
*/
void
-_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog)
+_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog)
{
struct prog_instruction *inst;
GLuint inputAttr;
@@ -626,7 +626,7 @@ _mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog)
* transforms vertex position and emits color.
*/
void
-_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog)
+_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog)
{
struct prog_instruction *inst;
GLuint inputAttr;
diff --git a/src/mesa/program/programopt.h b/src/mesa/program/programopt.h
index 4af6357f97..ef6f1bd079 100644
--- a/src/mesa/program/programopt.h
+++ b/src/mesa/program/programopt.h
@@ -29,10 +29,10 @@
#include "main/mtypes.h"
extern void
-_mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog);
+_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog);
extern void
-_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog);
+_mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog);
extern void
_mesa_count_texture_indirections(struct gl_program *prog);
@@ -44,10 +44,10 @@ extern void
_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type);
extern void
-_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog);
+_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog);
extern void
-_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog);
+_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog);
#endif /* PROGRAMOPT_H */