From: Brian Paul Date: Thu, 20 Jul 2006 16:49:57 +0000 (+0000) Subject: Some structure renaming. Prefix vertex/fragment-related structs with X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=122629f27925a9dc50029bebc5079f87f416a7e1;p=mesa.git Some structure renaming. Prefix vertex/fragment-related structs with "gl_" to match other structs. --- diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index a088c087b65..761a475714d 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -107,7 +107,7 @@ * mesa fragment_program struct. */ struct i915_fragment_program { - struct fragment_program FragProg; + struct gl_fragment_program FragProg; GLboolean translated; GLboolean params_uptodate; diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 5cd6ea4de51..b0cc59c3063 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -59,7 +59,7 @@ static const GLfloat cos_constants[4] = { 1.0, */ static GLuint src_vector( struct i915_fragment_program *p, const struct prog_src_register *source, - const struct fragment_program *program ) + const struct gl_fragment_program *program ) { GLuint src; @@ -244,7 +244,7 @@ do { \ */ static void upload_program( struct i915_fragment_program *p ) { - const struct fragment_program *program = p->ctx->FragmentProgram._Current; + const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current; const struct prog_instruction *inst = program->Base.Instructions; /* _mesa_debug_fp_inst(program->Base.NumInstructions, inst); */ @@ -837,7 +837,7 @@ static void track_params( struct i915_fragment_program *p ) static void i915BindProgram( GLcontext *ctx, GLenum target, - struct program *prog ) + struct gl_program *prog ) { if (target == GL_FRAGMENT_PROGRAM_ARB) { i915ContextPtr i915 = I915_CONTEXT(ctx); @@ -864,13 +864,13 @@ static void i915BindProgram( GLcontext *ctx, } } -static struct program *i915NewProgram( GLcontext *ctx, +static struct gl_program *i915NewProgram( GLcontext *ctx, GLenum target, GLuint id ) { switch (target) { case GL_VERTEX_PROGRAM_ARB: - return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(vertex_program), + return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(gl_vertex_program), target, id ); case GL_FRAGMENT_PROGRAM_ARB: { @@ -893,7 +893,7 @@ static struct program *i915NewProgram( GLcontext *ctx, } static void i915DeleteProgram( GLcontext *ctx, - struct program *prog ) + struct gl_program *prog ) { if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { i915ContextPtr i915 = I915_CONTEXT(ctx); @@ -909,7 +909,7 @@ static void i915DeleteProgram( GLcontext *ctx, static GLboolean i915IsProgramNative( GLcontext *ctx, GLenum target, - struct program *prog ) + struct gl_program *prog ) { if (target == GL_FRAGMENT_PROGRAM_ARB) { struct i915_fragment_program *p = (struct i915_fragment_program *)prog; @@ -925,7 +925,7 @@ static GLboolean i915IsProgramNative( GLcontext *ctx, static void i915ProgramStringNotify( GLcontext *ctx, GLenum target, - struct program *prog ) + struct gl_program *prog ) { if (target == GL_FRAGMENT_PROGRAM_ARB) { struct i915_fragment_program *p = (struct i915_fragment_program *)prog; diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index e1a53212a51..cf1673b429a 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -642,7 +642,7 @@ void intelChooseRenderState(GLcontext *ctx) TNLcontext *tnl = TNL_CONTEXT(ctx); intelContextPtr intel = INTEL_CONTEXT(ctx); GLuint flags = ctx->_TriangleCaps; - const struct fragment_program *fprog = ctx->FragmentProgram._Current; + const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current; GLboolean have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS)); GLuint index = 0; diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index df5c9f848a6..0f646bf30b9 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -100,7 +100,7 @@ typedef void (*r200_point_func)( r200ContextPtr, struct r200_vertex_program { - struct vertex_program mesa_program; /* Must be first */ + struct gl_vertex_program mesa_program; /* Must be first */ int translated; VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 2]; int pos_end; diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 00c236e839a..eaed68e7c8e 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -101,8 +101,8 @@ static GLboolean r200VertexProgUpdateParams(GLcontext *ctx, struct r200_vertex_p r200ContextPtr rmesa = R200_CONTEXT( ctx ); GLfloat *fcmd = (GLfloat *)&rmesa->hw.vpp[0].cmd[VPP_CMD_0 + 1]; int pi; - struct vertex_program *mesa_vp = (void *)vp; - struct program_parameter_list *paramList; + struct gl_vertex_program *mesa_vp = (void *)vp; + struct gl_program_parameter_list *paramList; drm_radeon_cmd_header_t tmp; R200_STATECHANGE( rmesa, vpp[0] ); @@ -391,7 +391,7 @@ static unsigned long op_operands(enum prog_opcode opcode) static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) { - struct vertex_program *mesa_vp = (void *)vp; + struct gl_vertex_program *mesa_vp = (void *)vp; struct prog_instruction *vpi; int i; VERTEX_SHADER_INSTRUCTION *o_inst; @@ -457,7 +457,7 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) }*/ /* FIXME: is changing the prog safe to do here? */ if (mesa_vp->IsPositionInvariant) { - struct program_parameter_list *paramList; + struct gl_program_parameter_list *paramList; GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX }; #ifdef PREFER_DP4 @@ -1053,7 +1053,8 @@ void r200SetupVertexProg( GLcontext *ctx ) { } -static void r200BindProgram(GLcontext *ctx, GLenum target, struct program *prog) +static void +r200BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog) { r200ContextPtr rmesa = R200_CONTEXT(ctx); @@ -1067,7 +1068,8 @@ static void r200BindProgram(GLcontext *ctx, GLenum target, struct program *prog) } } -static struct program *r200NewProgram(GLcontext *ctx, GLenum target, GLuint id) +static struct gl_program * +r200NewProgram(GLcontext *ctx, GLenum target, GLuint id) { struct r200_vertex_program *vp; @@ -1077,7 +1079,7 @@ static struct program *r200NewProgram(GLcontext *ctx, GLenum target, GLuint id) return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id); case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: - return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(fragment_program), target, id ); + return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(gl_fragment_program), target, id ); default: _mesa_problem(ctx, "Bad target in r200NewProgram"); } @@ -1085,19 +1087,21 @@ static struct program *r200NewProgram(GLcontext *ctx, GLenum target, GLuint id) } -static void r200DeleteProgram(GLcontext *ctx, struct program *prog) +static void +r200DeleteProgram(GLcontext *ctx, struct gl_program *prog) { _mesa_delete_program(ctx, prog); } -static void r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct program *prog) +static void +r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) { struct r200_vertex_program *vp = (void *)prog; switch(target) { case GL_VERTEX_PROGRAM_ARB: vp->translated = GL_FALSE; - memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct vertex_program)); + memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_vertex_program)); /*r200_translate_vertex_shader(vp);*/ break; } @@ -1105,7 +1109,8 @@ static void r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct progra _tnl_program_string(ctx, target, prog); } -static GLboolean r200IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog) +static GLboolean +r200IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog) { struct r200_vertex_program *vp = (void *)prog; diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index e1d5b085806..c70a47215d4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -617,7 +617,7 @@ extern int hw_tcl_on; * Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly. */ struct r300_vertex_program { - struct vertex_program mesa_program; /* Must be first */ + struct gl_vertex_program mesa_program; /* Must be first */ int translated; struct r300_vertex_shader_fragment program; @@ -671,7 +671,7 @@ struct r300_pfs_compile_state { }; struct r300_fragment_program { - struct fragment_program mesa_program; + struct gl_fragment_program mesa_program; GLcontext *ctx; GLboolean translated; @@ -804,7 +804,7 @@ struct r300_context { struct r300_hw_state hw; struct r300_cmdbuf cmdbuf; struct r300_state state; - struct vertex_program *curr_vp; + struct gl_vertex_program *curr_vp; /* Vertex buffers */ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 61efdec6a8d..4a13b36e646 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -529,7 +529,7 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp, } /* no point swizzling ONE/ZERO/HALF constants... */ - if (r.v_swz < SWIZZLE_111 || r.s_swz < SWIZZLE_ZERO) + if (r.v_swz < SWIZZLE_111 && r.s_swz < SWIZZLE_ZERO) r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase); #if 0 /* WRONG! Need to be able to do individual component negation, @@ -1018,7 +1018,7 @@ static void emit_arith(struct r300_fragment_program *rp, int op, #if 0 static pfs_reg_t get_attrib(struct r300_fragment_program *rp, GLuint attr) { - struct fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &rp->mesa_program; pfs_reg_t r = undef; if (!(mp->Base.InputsRead & (1<mesa_program; + struct gl_fragment_program *mp = &rp->mesa_program; const struct prog_instruction *inst = mp->Base.Instructions; struct prog_instruction *fpi; pfs_reg_t src[3], dest, temp; @@ -1355,7 +1355,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) static void init_program(struct r300_fragment_program *rp) { struct r300_pfs_compile_state *cs = NULL; - struct fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &rp->mesa_program; struct prog_instruction *fpi; GLuint InputsRead = mp->Base.InputsRead; GLuint temps_used = 0; /* for rp->temps[] */ @@ -1467,7 +1467,7 @@ static void init_program(struct r300_fragment_program *rp) static void update_params(struct r300_fragment_program *rp) { - struct fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &rp->mesa_program; int i; /* Ask Mesa nicely to fill in ParameterValues for us */ diff --git a/src/mesa/drivers/dri/r300/r300_program.h b/src/mesa/drivers/dri/r300/r300_program.h index 3defe106c2d..3210660df1c 100644 --- a/src/mesa/drivers/dri/r300/r300_program.h +++ b/src/mesa/drivers/dri/r300/r300_program.h @@ -145,6 +145,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ((arg1) << R300_FPI2_ARG1A_SHIFT) | \ ((arg2) << R300_FPI2_ARG2A_SHIFT)) -extern void debug_vp(GLcontext *ctx, struct vertex_program *vp); +extern void debug_vp(GLcontext *ctx, struct gl_vertex_program *vp); #endif /* __R300_PROGRAM_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 0c5596159d7..576b18953f9 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -7,7 +7,8 @@ #include "r300_context.h" #include "r300_fragprog.h" -static void r300BindProgram(GLcontext *ctx, GLenum target, struct program *prog) +static void +r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -16,7 +17,7 @@ static void r300BindProgram(GLcontext *ctx, GLenum target, struct program *prog) switch(target){ case GL_VERTEX_PROGRAM_ARB: - rmesa->curr_vp = (struct vertex_program *)vp; + rmesa->curr_vp = (struct gl_vertex_program *)vp; vp->ref_count++; #if 0 if((vp->ref_count % 1500) == 0) { @@ -33,7 +34,8 @@ static void r300BindProgram(GLcontext *ctx, GLenum target, struct program *prog) } } -static struct program *r300NewProgram(GLcontext *ctx, GLenum target, GLuint id) +static struct gl_program * +r300NewProgram(GLcontext *ctx, GLenum target, GLuint id) { struct r300_vertex_program *vp; struct r300_fragment_program *fp; @@ -58,7 +60,8 @@ static struct program *r300NewProgram(GLcontext *ctx, GLenum target, GLuint id) } -static void r300DeleteProgram(GLcontext *ctx, struct program *prog) +static void +r300DeleteProgram(GLcontext *ctx, struct gl_program *prog) { #if 0 r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -71,8 +74,8 @@ static void r300DeleteProgram(GLcontext *ctx, struct program *prog) _mesa_delete_program(ctx, prog); } -static void r300ProgramStringNotify(GLcontext *ctx, GLenum target, - struct program *prog) +static void +r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) { struct r300_vertex_program *vp=(void *)prog; struct r300_fragment_program *fp = (struct r300_fragment_program *) prog; @@ -80,7 +83,7 @@ static void r300ProgramStringNotify(GLcontext *ctx, GLenum target, switch(target) { case GL_VERTEX_PROGRAM_ARB: vp->translated = GL_FALSE; - memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct vertex_program)); + memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program)); /*r300_translate_vertex_shader(vp);*/ break; case GL_FRAGMENT_PROGRAM_ARB: @@ -91,7 +94,8 @@ static void r300ProgramStringNotify(GLcontext *ctx, GLenum target, _tnl_program_string(ctx, target, prog); } -static GLboolean r300IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog) +static GLboolean +r300IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog) { //struct r300_vertex_program *vp=(void *)prog; //r300ContextPtr rmesa = R300_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c index c62a5863eb9..45b419d04ec 100644 --- a/src/mesa/drivers/dri/r300/r300_vertexprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c @@ -98,9 +98,9 @@ static struct{ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst) { int pi; - struct vertex_program *mesa_vp=(void *)vp; + struct gl_vertex_program *mesa_vp=(void *)vp; float *dst_o=dst; - struct program_parameter_list *paramList; + struct gl_program_parameter_list *paramList; if (mesa_vp->IsNVProgram) { _mesa_init_vp_per_primitive_registers(ctx); @@ -386,7 +386,7 @@ static unsigned long op_operands(enum prog_opcode opcode) void r300_translate_vertex_shader(struct r300_vertex_program *vp) { - struct vertex_program *mesa_vp=(void *)vp; + struct gl_vertex_program *mesa_vp=(void *)vp; struct prog_instruction *vpi; int i, cur_reg=0; VERTEX_SHADER_INSTRUCTION *o_inst; @@ -433,7 +433,7 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp) } if (mesa_vp->IsPositionInvariant) { - struct program_parameter_list *paramList; + struct gl_program_parameter_list *paramList; GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX }; #ifdef PREFER_DP4 diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 61e1d8794a6..b30d5523623 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -829,7 +829,7 @@ delete_texture_cb(GLuint id, void *data, void *userData) static void delete_program_cb(GLuint id, void *data, void *userData) { - struct program *prog = (struct program *) data; + struct gl_program *prog = (struct gl_program *) data; GLcontext *ctx = (GLcontext *) userData; ctx->Driver.DeleteProgram(ctx, prog); } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 6675d56ed82..1b8cf6304e5 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -583,20 +583,20 @@ struct dd_function_table { */ /*@{*/ /** Bind a vertex/fragment program */ - void (*BindProgram)(GLcontext *ctx, GLenum target, struct program *prog); + void (*BindProgram)(GLcontext *ctx, GLenum target, struct gl_program *prog); /** Allocate a new program */ - struct program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id); + struct gl_program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id); /** Delete a program */ - void (*DeleteProgram)(GLcontext *ctx, struct program *prog); + void (*DeleteProgram)(GLcontext *ctx, struct gl_program *prog); /** Notify driver that a program string has been specified. */ void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, - struct program *prog); + struct gl_program *prog); /** Query if program can be loaded onto hardware */ GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, - struct program *prog); + struct gl_program *prog); /*@}*/ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e2eeedf2951..5e872d9dc38 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1517,7 +1517,7 @@ struct gl_texture_unit struct texenvprog_cache_item { GLuint hash; void *key; - struct fragment_program *data; + struct gl_fragment_program *data; struct texenvprog_cache_item *next; }; @@ -1843,13 +1843,13 @@ enum register_file /** Vertex and fragment instructions */ struct prog_instruction; -struct program_parameter_list; +struct gl_program_parameter_list; /** * Base class for any kind of program object */ -struct program +struct gl_program { GLuint Id; GLubyte *String; /**< Null-terminated program text */ @@ -1864,7 +1864,7 @@ struct program GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */ /** Named parameters, constants, etc. from program text */ - struct program_parameter_list *Parameters; + struct gl_program_parameter_list *Parameters; /** Numbered local parameters */ GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; @@ -1888,19 +1888,19 @@ struct program /** Vertex program object */ -struct vertex_program +struct gl_vertex_program { - struct program Base; /* base class */ - GLboolean IsNVProgram; /* GL_NV_vertex_program ? */ - GLboolean IsPositionInvariant; /* GL_ARB_vertex_program / GL_NV_vertex_program1_1 */ - void *TnlData; /* should probably use Base.DriverData */ + struct gl_program Base; /**< base class */ + GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ + GLboolean IsPositionInvariant; + void *TnlData; /**< should probably use Base.DriverData */ }; /** Fragment program object */ -struct fragment_program +struct gl_fragment_program { - struct program Base; /**< base class */ + struct gl_program Base; /**< base class */ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */ GLuint NumAluInstructions; /**< GL_ARB_fragment_program */ GLuint NumTexInstructions; @@ -1932,8 +1932,8 @@ struct gl_vertex_program_state GLboolean _Enabled; /**< Enabled and valid program? */ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ - struct vertex_program *Current; /**< ptr to currently bound program */ - const struct vertex_program *_Current; /**< ptr to currently bound + struct gl_vertex_program *Current; /**< ptr to currently bound program */ + const struct gl_vertex_program *_Current; /**< ptr to currently bound program, including internal (t_vp_build.c) programs */ @@ -1965,8 +1965,8 @@ struct gl_fragment_program_state GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */ GLboolean _Enabled; /* Enabled and valid program? */ GLboolean _Active; - struct fragment_program *Current; /* ptr to currently bound program */ - const struct fragment_program *_Current; /* ptr to currently active program + struct gl_fragment_program *Current; /* ptr to currently bound program */ + const struct gl_fragment_program *_Current; /* ptr to currently active program (including internal programs) */ struct fp_machine Machine; /* machine state */ GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */ @@ -2096,10 +2096,10 @@ struct gl_shared_state /*@{*/ struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */ #if FEATURE_ARB_vertex_program - struct program *DefaultVertexProgram; + struct gl_program *DefaultVertexProgram; #endif #if FEATURE_ARB_fragment_program - struct program *DefaultFragmentProgram; + struct gl_program *DefaultFragmentProgram; #endif /*@}*/ @@ -2920,8 +2920,8 @@ struct __GLcontextRec struct gl_fragment_program_state FragmentProgram; /**< GL_ARB/NV_vertex_program */ struct gl_ati_fragment_shader_state ATIFragmentShader; /**< GL_ATI_fragment_shader */ - struct fragment_program *_TexEnvProgram; /**< Texture state as fragment program */ - struct vertex_program *_TnlProgram; /**< Fixed func TNL state as vertex program */ + struct gl_fragment_program *_TexEnvProgram; /**< Texture state as fragment program */ + struct gl_vertex_program *_TnlProgram; /**< Fixed func TNL state as vertex program */ GLboolean _MaintainTnlProgram; GLboolean _MaintainTexEnvProgram; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 784757e91f9..0b7214f9dd0 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -955,7 +955,7 @@ update_program(GLcontext *ctx) if (ctx->_MaintainTexEnvProgram && !ctx->FragmentProgram._Enabled) { #if 0 if (!ctx->_TexEnvProgram) - ctx->_TexEnvProgram = (struct fragment_program *) + ctx->_TexEnvProgram = (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); ctx->FragmentProgram._Current = ctx->_TexEnvProgram; #endif diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 0a43f7ac4ad..bce570b3b2c 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -271,7 +271,7 @@ static const struct ureg undef = { /* State used to build the fragment program: */ struct texenv_fragment_program { - struct fragment_program *program; + struct gl_fragment_program *program; GLcontext *ctx; struct state_key *state; @@ -989,7 +989,7 @@ load_texunit_sources( struct texenv_fragment_program *p, int unit ) */ static void create_new_program(struct state_key *key, GLcontext *ctx, - struct fragment_program *program) + struct gl_fragment_program *program) { struct texenv_fragment_program p; GLuint unit; @@ -1103,7 +1103,7 @@ create_new_program(struct state_key *key, GLcontext *ctx, } -static struct fragment_program * +static struct gl_fragment_program * search_cache(const struct texenvprog_cache *cache, GLuint hash, const void *key, @@ -1113,7 +1113,7 @@ search_cache(const struct texenvprog_cache *cache, for (c = cache->items[hash % cache->size]; c; c = c->next) { if (c->hash == hash && memcmp(c->key, key, keysize) == 0) - return (struct fragment_program *) c->data; + return (struct gl_fragment_program *) c->data; } return NULL; @@ -1150,7 +1150,8 @@ static void clear_cache( struct texenvprog_cache *cache ) for (c = cache->items[i]; c; c = next) { next = c->next; _mesa_free(c->key); - cache->ctx->Driver.DeleteProgram(cache->ctx, (struct program *)c->data); + cache->ctx->Driver.DeleteProgram(cache->ctx, + (struct gl_program *) c->data); _mesa_free(c); } cache->items[i] = NULL; @@ -1207,7 +1208,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) { struct state_key key; GLuint hash; - const struct fragment_program *prev = ctx->FragmentProgram._Current; + const struct gl_fragment_program *prev = ctx->FragmentProgram._Current; if (!ctx->FragmentProgram._Enabled) { make_state_key(ctx, &key); @@ -1221,7 +1222,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) if (0) _mesa_printf("Building new texenv proggy for key %x\n", hash); ctx->FragmentProgram._Current = ctx->_TexEnvProgram = - (struct fragment_program *) + (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); create_new_program(&key, ctx, ctx->_TexEnvProgram); @@ -1240,7 +1241,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) */ if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) { ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct program *) ctx->FragmentProgram._Current); + (struct gl_program *) ctx->FragmentProgram._Current); } } diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 12db64612ee..39e74576cee 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -51,7 +51,7 @@ */ struct arb_program { - struct program Base; + struct gl_program Base; GLuint Position; /* Just used for error reporting while parsing */ GLuint MajorVersion; @@ -4060,7 +4060,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, void _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, const GLvoid *str, GLsizei len, - struct fragment_program *program) + struct gl_fragment_program *program) { struct arb_program ap; GLuint i; @@ -4115,7 +4115,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, void _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, - struct vertex_program *program) + struct gl_vertex_program *program) { struct arb_program ap; diff --git a/src/mesa/shader/arbprogparse.h b/src/mesa/shader/arbprogparse.h index ad4046dfacf..4574e5cd553 100644 --- a/src/mesa/shader/arbprogparse.h +++ b/src/mesa/shader/arbprogparse.h @@ -31,11 +31,11 @@ extern void _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, - struct vertex_program *program); + struct gl_vertex_program *program); extern void _mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, - struct fragment_program *program); + struct gl_fragment_program *program); #endif diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 8283033f864..346263d8668 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -195,7 +195,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { - struct vertex_program *prog = ctx->VertexProgram.Current; + struct gl_vertex_program *prog = ctx->VertexProgram.Current; _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); if (ctx->Driver.ProgramStringNotify) @@ -203,7 +203,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { - struct fragment_program *prog = ctx->FragmentProgram.Current; + struct gl_fragment_program *prog = ctx->FragmentProgram.Current; _mesa_parse_arb_fragment_program(ctx, target, string, len, prog); if (ctx->Driver.ProgramStringNotify) @@ -335,7 +335,7 @@ _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { GET_CURRENT_CONTEXT(ctx); - struct program *prog; + struct gl_program *prog; ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_VERTICES(ctx, _NEW_PROGRAM); @@ -416,7 +416,7 @@ void GLAPIENTRY _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params) { - const struct program *prog; + const struct gl_program *prog; GLuint maxParams; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -474,7 +474,7 @@ void GLAPIENTRY _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) { const struct gl_program_constants *limits; - struct program *prog; + struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); if (!ctx->_CurrentProgram) @@ -598,7 +598,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) * The following apply to fragment programs only (at this time) */ if (target == GL_FRAGMENT_PROGRAM_ARB) { - const struct fragment_program *fp = ctx->FragmentProgram.Current; + const struct gl_fragment_program *fp = ctx->FragmentProgram.Current; switch (pname) { case GL_PROGRAM_ALU_INSTRUCTIONS_ARB: *params = fp->NumNativeAluInstructions; @@ -647,7 +647,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) void GLAPIENTRY _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) { - const struct program *prog; + const struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); if (!ctx->_CurrentProgram) diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 14de7cdd52b..364c7061ee1 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -146,9 +146,9 @@ struct parse_state { const GLubyte *start; /* start of program string */ const GLubyte *pos; /* current position */ const GLubyte *curLine; - struct fragment_program *program; /* current program */ + struct gl_fragment_program *program; /* current program */ - struct program_parameter_list *parameters; + struct gl_program_parameter_list *parameters; GLuint numInst; /* number of instructions parsed */ GLuint inputsRead; /* bitmask of input registers used */ @@ -1452,7 +1452,7 @@ Parse_InstructionSequence(struct parse_state *parseState, void _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, const GLubyte *str, GLsizei len, - struct fragment_program *program) + struct gl_fragment_program *program) { struct parse_state parseState; struct prog_instruction instBuffer[MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS]; @@ -1569,7 +1569,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, static void -PrintSrcReg(const struct fragment_program *program, +PrintSrcReg(const struct gl_fragment_program *program, const struct prog_src_register *src) { static const char comps[5] = "xyzw"; @@ -1731,7 +1731,7 @@ PrintDstReg(const struct prog_dst_register *dst) * Print (unparse) the given vertex program. Just for debugging. */ void -_mesa_print_nv_fragment_program(const struct fragment_program *program) +_mesa_print_nv_fragment_program(const struct gl_fragment_program *program) { const struct prog_instruction *inst; diff --git a/src/mesa/shader/nvfragparse.h b/src/mesa/shader/nvfragparse.h index 849a7fbc7d6..de45cf543db 100644 --- a/src/mesa/shader/nvfragparse.h +++ b/src/mesa/shader/nvfragparse.h @@ -34,11 +34,11 @@ extern void _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, - struct fragment_program *program); + struct gl_fragment_program *program); extern void -_mesa_print_nv_fragment_program(const struct fragment_program *program); +_mesa_print_nv_fragment_program(const struct gl_fragment_program *program); extern const char * diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 758d62c1378..3a5c053b311 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -59,7 +59,7 @@ void GLAPIENTRY _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) { - struct vertex_program *vprog; + struct gl_vertex_program *vprog; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -70,7 +70,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) FLUSH_VERTICES(ctx, _NEW_PROGRAM); - vprog = (struct vertex_program *) + vprog = (struct gl_vertex_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!vprog || vprog->Base.Target != GL_VERTEX_STATE_PROGRAM_NV) { @@ -104,12 +104,12 @@ GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, } for (i = 0; i < n; i++) { - const struct program *prog; + const struct gl_program *prog; if (ids[i] == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); return GL_FALSE; } - prog = (const struct program *) + prog = (const struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]); if (!prog) { _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); @@ -151,14 +151,14 @@ _mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids) /* just error checking for now */ for (i = 0; i < n; i++) { - struct program *prog; + struct gl_program *prog; if (ids[i] == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); return; } - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]); if (!prog) { _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); return; @@ -248,13 +248,13 @@ _mesa_GetProgramParameterdvNV(GLenum target, GLuint index, void GLAPIENTRY _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) { - struct program *prog; + struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); if (!ctx->_CurrentProgram) ASSERT_OUTSIDE_BEGIN_END(ctx); - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!prog) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramivNV"); return; @@ -285,7 +285,7 @@ _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) void GLAPIENTRY _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) { - struct program *prog; + struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); if (!ctx->_CurrentProgram) @@ -296,7 +296,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) return; } - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!prog) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramStringNV"); return; @@ -506,7 +506,7 @@ void GLAPIENTRY _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program) { - struct program *prog; + struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -522,7 +522,7 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, FLUSH_VERTICES(ctx, _NEW_PROGRAM); - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (prog && prog->Target != 0 && prog->Target != target) { _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(target)"); @@ -532,9 +532,9 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, if ((target == GL_VERTEX_PROGRAM_NV || target == GL_VERTEX_STATE_PROGRAM_NV) && ctx->Extensions.NV_vertex_program) { - struct vertex_program *vprog = (struct vertex_program *) prog; + struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; if (!vprog || prog == &_mesa_DummyProgram) { - vprog = (struct vertex_program *) + vprog = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, target, id); if (!vprog) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); @@ -546,9 +546,9 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, } else if (target == GL_FRAGMENT_PROGRAM_NV && ctx->Extensions.NV_fragment_program) { - struct fragment_program *fprog = (struct fragment_program *) prog; + struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; if (!fprog || prog == &_mesa_DummyProgram) { - fprog = (struct fragment_program *) + fprog = (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, target, id); if (!fprog) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); @@ -764,8 +764,8 @@ void GLAPIENTRY _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - struct program *prog; - struct fragment_program *fragProg; + struct gl_program *prog; + struct gl_fragment_program *fragProg; GLfloat *v; GET_CURRENT_CONTEXT(ctx); @@ -773,7 +773,7 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, FLUSH_VERTICES(ctx, _NEW_PROGRAM); - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramNamedParameterNV"); return; @@ -784,7 +784,7 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, return; } - fragProg = (struct fragment_program *) prog; + fragProg = (struct gl_fragment_program *) prog; v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len, (char *) name); if (v) { @@ -830,8 +830,8 @@ void GLAPIENTRY _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params) { - struct program *prog; - struct fragment_program *fragProg; + struct gl_program *prog; + struct gl_fragment_program *fragProg; const GLfloat *v; GET_CURRENT_CONTEXT(ctx); @@ -839,7 +839,7 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, if (!ctx->_CurrentProgram) ASSERT_OUTSIDE_BEGIN_END(ctx); - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramNamedParameterNV"); return; @@ -850,7 +850,7 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, return; } - fragProg = (struct fragment_program *) prog; + fragProg = (struct gl_fragment_program *) prog; v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len, (char *) name); if (v) { diff --git a/src/mesa/shader/nvvertexec.c b/src/mesa/shader/nvvertexec.c index fc5837812e2..c436f4f0451 100644 --- a/src/mesa/shader/nvvertexec.c +++ b/src/mesa/shader/nvvertexec.c @@ -379,7 +379,7 @@ store_vector4( const struct prog_dst_register *dest, * Execute the given vertex program */ void -_mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) +_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program) { struct gl_vertex_program_state *state = &ctx->VertexProgram; const struct prog_instruction *inst; diff --git a/src/mesa/shader/nvvertexec.h b/src/mesa/shader/nvvertexec.h index cdf1bd588bf..e0fd46a7662 100644 --- a/src/mesa/shader/nvvertexec.h +++ b/src/mesa/shader/nvvertexec.h @@ -35,7 +35,7 @@ extern void _mesa_init_vp_per_primitive_registers(GLcontext *ctx); extern void -_mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program); +_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program); extern void _mesa_dump_vp_state( const struct gl_vertex_program_state *state ); diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index ebfe1fdeefd..927bf60c9fc 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1290,7 +1290,7 @@ Parse_Program(struct parse_state *parseState, void _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, const GLubyte *str, GLsizei len, - struct vertex_program *program) + struct gl_vertex_program *program) { struct parse_state parseState; struct prog_instruction instBuffer[MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS]; @@ -1562,7 +1562,7 @@ _mesa_print_nv_vertex_instruction(const struct prog_instruction *inst) * Print (unparse) the given vertex program. Just for debugging. */ void -_mesa_print_nv_vertex_program(const struct vertex_program *program) +_mesa_print_nv_vertex_program(const struct gl_vertex_program *program) { const struct prog_instruction *inst; diff --git a/src/mesa/shader/nvvertparse.h b/src/mesa/shader/nvvertparse.h index d78d9fa1370..15fb03cd4e4 100644 --- a/src/mesa/shader/nvvertparse.h +++ b/src/mesa/shader/nvvertparse.h @@ -33,13 +33,13 @@ extern void _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, - struct vertex_program *program); + struct gl_vertex_program *program); extern void _mesa_print_nv_vertex_instruction(const struct prog_instruction *inst); extern void -_mesa_print_nv_vertex_program(const struct vertex_program *program); +_mesa_print_nv_vertex_program(const struct gl_vertex_program *program); extern const char * _mesa_nv_vertex_input_register_name(GLuint i); diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 7a8950288ba..352ed93465e 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -57,7 +57,7 @@ make_state_flags(const GLint state[]); /* A pointer to this dummy program is put into the hash table when * glGenPrograms is called. */ -struct program _mesa_DummyProgram; +struct gl_program _mesa_DummyProgram; /** @@ -75,7 +75,7 @@ _mesa_init_program(GLcontext *ctx) ctx->VertexProgram.Enabled = GL_FALSE; ctx->VertexProgram.PointSizeEnabled = GL_FALSE; ctx->VertexProgram.TwoSideEnabled = GL_FALSE; - ctx->VertexProgram.Current = (struct vertex_program *) ctx->Shared->DefaultVertexProgram; + ctx->VertexProgram.Current = (struct gl_vertex_program *) ctx->Shared->DefaultVertexProgram; assert(ctx->VertexProgram.Current); ctx->VertexProgram.Current->Base.RefCount++; for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) { @@ -86,7 +86,7 @@ _mesa_init_program(GLcontext *ctx) #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program ctx->FragmentProgram.Enabled = GL_FALSE; - ctx->FragmentProgram.Current = (struct fragment_program *) ctx->Shared->DefaultFragmentProgram; + ctx->FragmentProgram.Current = (struct gl_fragment_program *) ctx->Shared->DefaultFragmentProgram; assert(ctx->FragmentProgram.Current); ctx->FragmentProgram.Current->Base.RefCount++; #endif @@ -197,8 +197,8 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, /** * Initialize a new vertex/fragment program object. */ -static struct program * -_mesa_init_program_struct( GLcontext *ctx, struct program *prog, +static struct gl_program * +_mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, GLenum target, GLuint id) { (void) ctx; @@ -216,8 +216,8 @@ _mesa_init_program_struct( GLcontext *ctx, struct program *prog, /** * Initialize a new fragment program object. */ -struct program * -_mesa_init_fragment_program( GLcontext *ctx, struct fragment_program *prog, +struct gl_program * +_mesa_init_fragment_program( GLcontext *ctx, struct gl_fragment_program *prog, GLenum target, GLuint id) { if (prog) @@ -230,8 +230,8 @@ _mesa_init_fragment_program( GLcontext *ctx, struct fragment_program *prog, /** * Initialize a new vertex program object. */ -struct program * -_mesa_init_vertex_program( GLcontext *ctx, struct vertex_program *prog, +struct gl_program * +_mesa_init_vertex_program( GLcontext *ctx, struct gl_vertex_program *prog, GLenum target, GLuint id) { if (prog) @@ -253,17 +253,18 @@ _mesa_init_vertex_program( GLcontext *ctx, struct vertex_program *prog, * \param target program target/type * \return pointer to new program object */ -struct program * +struct gl_program * _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id) { switch (target) { case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(vertex_program), - target, id ); + return _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program), + target, id ); case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: - return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(fragment_program), - target, id ); + return _mesa_init_fragment_program(ctx, + CALLOC_STRUCT(gl_fragment_program), + target, id ); default: _mesa_problem(ctx, "bad target in _mesa_new_program"); return NULL; @@ -278,7 +279,7 @@ _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id) * by a device driver function. */ void -_mesa_delete_program(GLcontext *ctx, struct program *prog) +_mesa_delete_program(GLcontext *ctx, struct gl_program *prog) { (void) ctx; ASSERT(prog); @@ -308,11 +309,11 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog) /* Program parameter functions */ /**********************************************************************/ -struct program_parameter_list * +struct gl_program_parameter_list * _mesa_new_parameter_list(void) { - return (struct program_parameter_list *) - _mesa_calloc(sizeof(struct program_parameter_list)); + return (struct gl_program_parameter_list *) + _mesa_calloc(sizeof(struct gl_program_parameter_list)); } @@ -320,7 +321,7 @@ _mesa_new_parameter_list(void) * Free a parameter list and all its parameters */ void -_mesa_free_parameter_list(struct program_parameter_list *paramList) +_mesa_free_parameter_list(struct gl_program_parameter_list *paramList) { GLuint i; for (i = 0; i < paramList->NumParameters; i++) { @@ -343,7 +344,7 @@ _mesa_free_parameter_list(struct program_parameter_list *paramList) * \return index of new parameter in the list, or -1 if error (out of mem) */ static GLint -add_parameter(struct program_parameter_list *paramList, +add_parameter(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4], enum register_file type) { @@ -357,10 +358,10 @@ add_parameter(struct program_parameter_list *paramList, paramList->Size *= 2; /* realloc arrays */ - paramList->Parameters = (struct program_parameter *) + paramList->Parameters = (struct gl_program_parameter *) _mesa_realloc(paramList->Parameters, - n * sizeof(struct program_parameter), - paramList->Size * sizeof(struct program_parameter)); + n * sizeof(struct gl_program_parameter), + paramList->Size * sizeof(struct gl_program_parameter)); paramList->ParameterValues = (GLfloat (*)[4]) _mesa_align_realloc(paramList->ParameterValues, /* old buf */ @@ -380,7 +381,7 @@ add_parameter(struct program_parameter_list *paramList, paramList->NumParameters = n + 1; _mesa_memset(¶mList->Parameters[n], 0, - sizeof(struct program_parameter)); + sizeof(struct gl_program_parameter)); paramList->Parameters[n].Name = name ? _mesa_strdup(name) : NULL; paramList->Parameters[n].Type = type; @@ -396,7 +397,7 @@ add_parameter(struct program_parameter_list *paramList, * \return index of the new entry in the parameter list */ GLint -_mesa_add_named_parameter(struct program_parameter_list *paramList, +_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4]) { return add_parameter(paramList, name, values, PROGRAM_NAMED_PARAM); @@ -410,7 +411,7 @@ _mesa_add_named_parameter(struct program_parameter_list *paramList, * \return index of the new parameter. */ GLint -_mesa_add_named_constant(struct program_parameter_list *paramList, +_mesa_add_named_constant(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4]) { return add_parameter(paramList, name, values, PROGRAM_CONSTANT); @@ -424,7 +425,7 @@ _mesa_add_named_constant(struct program_parameter_list *paramList, * \return index of the new parameter. */ GLint -_mesa_add_unnamed_constant(struct program_parameter_list *paramList, +_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, const GLfloat values[4]) { return add_parameter(paramList, NULL, values, PROGRAM_CONSTANT); @@ -439,7 +440,7 @@ _mesa_add_unnamed_constant(struct program_parameter_list *paramList, * \return index of the new parameter. */ GLint -_mesa_add_state_reference(struct program_parameter_list *paramList, +_mesa_add_state_reference(struct gl_program_parameter_list *paramList, const GLint *stateTokens) { /* XXX we should probably search the current parameter list to see if @@ -471,7 +472,7 @@ _mesa_add_state_reference(struct program_parameter_list *paramList, * \return pointer to the float[4] values. */ GLfloat * -_mesa_lookup_parameter_value(struct program_parameter_list *paramList, +_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { GLuint i; @@ -505,7 +506,7 @@ _mesa_lookup_parameter_value(struct program_parameter_list *paramList, * \return index of parameter in the list. */ GLint -_mesa_lookup_parameter_index(struct program_parameter_list *paramList, +_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { GLint i; @@ -811,6 +812,7 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], modifier == STATE_MATRIX_INVTRANS) { /* Be sure inverse is up to date: */ + _math_matrix_alloc_inv( (GLmatrix *) matrix ); _math_matrix_analyse( (GLmatrix*) matrix ); m = matrix->inv; } @@ -1246,7 +1248,7 @@ make_state_string(const GLint state[6]) */ void _mesa_load_state_parameters(GLcontext *ctx, - struct program_parameter_list *paramList) + struct gl_program_parameter_list *paramList) { GLuint i; @@ -1631,7 +1633,7 @@ _mesa_print_instruction(const struct prog_instruction *inst) * XXX this function could be greatly improved. */ void -_mesa_print_program(const struct program *prog) +_mesa_print_program(const struct gl_program *prog) { GLuint i; for (i = 0; i < prog->NumInstructions; i++) { @@ -1645,7 +1647,7 @@ _mesa_print_program(const struct program *prog) * Print all of a program's parameters. */ void -_mesa_print_program_parameters(GLcontext *ctx, const struct program *prog) +_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog) { GLint i; @@ -1666,7 +1668,7 @@ _mesa_print_program_parameters(GLcontext *ctx, const struct program *prog) #endif for (i = 0; i < prog->Parameters->NumParameters; i++){ - struct program_parameter *param = prog->Parameters->Parameters + i; + struct gl_program_parameter *param = prog->Parameters->Parameters + i; const GLfloat *v = prog->Parameters->ParameterValues[i]; _mesa_printf("param[%d] %s = {%.3f, %.3f, %.3f, %.3f};\n", i, param->Name, v[0], v[1], v[2], v[3]); @@ -1688,7 +1690,7 @@ _mesa_print_program_parameters(GLcontext *ctx, const struct program *prog) void GLAPIENTRY _mesa_BindProgram(GLenum target, GLuint id) { - struct program *prog; + struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1698,7 +1700,7 @@ _mesa_BindProgram(GLenum target, GLuint id) (ctx->Extensions.NV_vertex_program || ctx->Extensions.ARB_vertex_program)) { /*** Vertex program binding ***/ - struct vertex_program *curProg = ctx->VertexProgram.Current; + struct gl_vertex_program *curProg = ctx->VertexProgram.Current; if (curProg->Base.Id == id) { /* binding same program - no change */ return; @@ -1718,7 +1720,7 @@ _mesa_BindProgram(GLenum target, GLuint id) (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program)) { /*** Fragment program binding ***/ - struct fragment_program *curProg = ctx->FragmentProgram.Current; + struct gl_fragment_program *curProg = ctx->FragmentProgram.Current; if (curProg->Base.Id == id) { /* binding same program - no change */ return; @@ -1751,7 +1753,7 @@ _mesa_BindProgram(GLenum target, GLuint id) } else { /* Bind user program */ - prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id); + prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id); if (!prog || prog == &_mesa_DummyProgram) { /* allocate a new program now */ prog = ctx->Driver.NewProgram(ctx, target, id); @@ -1770,10 +1772,10 @@ _mesa_BindProgram(GLenum target, GLuint id) /* bind now */ if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */ - ctx->VertexProgram.Current = (struct vertex_program *) prog; + ctx->VertexProgram.Current = (struct gl_vertex_program *) prog; } else if (target == GL_FRAGMENT_PROGRAM_NV || target == GL_FRAGMENT_PROGRAM_ARB) { - ctx->FragmentProgram.Current = (struct fragment_program *) prog; + ctx->FragmentProgram.Current = (struct gl_fragment_program *) prog; } /* Never null pointers */ @@ -1807,7 +1809,7 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) for (i = 0; i < n; i++) { if (ids[i] != 0) { - struct program *prog = (struct program *) + struct gl_program *prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]); if (prog == &_mesa_DummyProgram) { _mesa_HashRemove(ctx->Shared->Programs, ids[i]); diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 4b227877d43..3d50c23b4ed 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -74,7 +74,7 @@ #define WRITEMASK_XYZW 0xf -extern struct program _mesa_DummyProgram; +extern struct gl_program _mesa_DummyProgram; /* @@ -95,21 +95,21 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, GLint *line, GLint *col); -extern struct program * +extern struct gl_program * _mesa_init_vertex_program(GLcontext *ctx, - struct vertex_program *prog, + struct gl_vertex_program *prog, GLenum target, GLuint id); -extern struct program * +extern struct gl_program * _mesa_init_fragment_program(GLcontext *ctx, - struct fragment_program *prog, + struct gl_fragment_program *prog, GLenum target, GLuint id); -extern struct program * +extern struct gl_program * _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id); extern void -_mesa_delete_program(GLcontext *ctx, struct program *prog); +_mesa_delete_program(GLcontext *ctx, struct gl_program *prog); @@ -190,7 +190,7 @@ enum state_index { * and ARB_fragment_program global state references. For the later, Name * might be "state.light[0].diffuse", for example. */ -struct program_parameter +struct gl_program_parameter { const char *Name; /**< Null-terminated string */ enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ @@ -201,11 +201,11 @@ struct program_parameter /** * A list of the above program_parameter instances. */ -struct program_parameter_list +struct gl_program_parameter_list { GLuint Size; /**< allocated size of Parameters, ParameterValues */ GLuint NumParameters; /**< number of parameters in arrays */ - struct program_parameter *Parameters; /**< Array [Size] */ + struct gl_program_parameter *Parameters; /**< Array [Size] */ GLfloat (*ParameterValues)[4]; /**< Array [Size] of GLfloat[4] */ GLbitfield StateFlags; /**< _NEW_* flags indicating which state changes might invalidate ParameterValues[] */ @@ -216,39 +216,39 @@ struct program_parameter_list * Program parameter functions */ -extern struct program_parameter_list * +extern struct gl_program_parameter_list * _mesa_new_parameter_list(void); extern void -_mesa_free_parameter_list(struct program_parameter_list *paramList); +_mesa_free_parameter_list(struct gl_program_parameter_list *paramList); extern GLint -_mesa_add_named_parameter(struct program_parameter_list *paramList, +_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4]); extern GLint -_mesa_add_named_constant(struct program_parameter_list *paramList, +_mesa_add_named_constant(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4]); extern GLint -_mesa_add_unnamed_constant(struct program_parameter_list *paramList, +_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, const GLfloat values[4]); extern GLint -_mesa_add_state_reference(struct program_parameter_list *paramList, +_mesa_add_state_reference(struct gl_program_parameter_list *paramList, const GLint *stateTokens); extern GLfloat * -_mesa_lookup_parameter_value(struct program_parameter_list *paramList, +_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name); extern GLint -_mesa_lookup_parameter_index(struct program_parameter_list *paramList, +_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name); extern void _mesa_load_state_parameters(GLcontext *ctx, - struct program_parameter_list *paramList); + struct gl_program_parameter_list *paramList); @@ -256,10 +256,10 @@ extern void _mesa_print_instruction(const struct prog_instruction *inst); extern void -_mesa_print_program(const struct program *prog); +_mesa_print_program(const struct gl_program *prog); extern void -_mesa_print_program_parameters(GLcontext *ctx, const struct program *prog); +_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog); /* diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index a2438813222..57b5364c8c1 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -208,11 +208,11 @@ _swrast_update_fog_state( GLcontext *ctx ) swrast->_FogEnabled = GL_FALSE; if (ctx->FragmentProgram._Active) { if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) { - const struct fragment_program *p - = (struct fragment_program *) ctx->FragmentProgram._Current; - if (p->FogOption != GL_NONE) { + const struct gl_fragment_program *fp + = ctx->FragmentProgram._Current; + if (fp->FogOption != GL_NONE) { swrast->_FogEnabled = GL_TRUE; - swrast->_FogMode = p->FogOption; + swrast->_FogMode = fp->FogOption; } } } @@ -231,8 +231,8 @@ static void _swrast_update_fragment_program( GLcontext *ctx ) { if (ctx->FragmentProgram._Active) { - const struct fragment_program *program = ctx->FragmentProgram._Current; - _mesa_load_state_parameters(ctx, program->Base.Parameters); + const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; + _mesa_load_state_parameters(ctx, fp->Base.Parameters); } } diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 7c59a2bb594..fa16a41e289 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -106,7 +106,7 @@ static INLINE const GLfloat * get_register_pointer( GLcontext *ctx, const struct prog_src_register *source, const struct fp_machine *machine, - const struct fragment_program *program ) + const struct gl_fragment_program *program ) { const GLfloat *src; switch (source->File) { @@ -153,7 +153,7 @@ static void fetch_vector4( GLcontext *ctx, const struct prog_src_register *source, const struct fp_machine *machine, - const struct fragment_program *program, + const struct gl_fragment_program *program, GLfloat result[4] ) { const GLfloat *src = get_register_pointer(ctx, source, machine, program); @@ -323,7 +323,7 @@ static void fetch_vector1( GLcontext *ctx, const struct prog_src_register *source, const struct fp_machine *machine, - const struct fragment_program *program, + const struct gl_fragment_program *program, GLfloat result[4] ) { const GLfloat *src = get_register_pointer(ctx, source, machine, program); @@ -477,7 +477,7 @@ store_vector4( const struct prog_instruction *inst, static void init_machine_deriv( GLcontext *ctx, const struct fp_machine *machine, - const struct fragment_program *program, + const struct gl_fragment_program *program, const struct sw_span *span, char xOrY, struct fp_machine *dMachine ) { @@ -588,7 +588,7 @@ init_machine_deriv( GLcontext *ctx, */ static GLboolean execute_program( GLcontext *ctx, - const struct fragment_program *program, GLuint maxInst, + const struct gl_fragment_program *program, GLuint maxInst, struct fp_machine *machine, const struct sw_span *span, GLuint column ) { @@ -1381,7 +1381,7 @@ execute_program( GLcontext *ctx, static void init_machine( GLcontext *ctx, struct fp_machine *machine, - const struct fragment_program *program, + const struct gl_fragment_program *program, const struct sw_span *span, GLuint col ) { GLuint inputsRead = program->Base.InputsRead; @@ -1452,7 +1452,7 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, void _swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span ) { - const struct fragment_program *program = ctx->FragmentProgram._Current; + const struct gl_fragment_program *program = ctx->FragmentProgram._Current; GLuint i; ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index dcb5290ef20..0677a1fd3b2 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -261,7 +261,7 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; struct tnl_vertex_arrays *tmp = &tnl->array_inputs; - const struct vertex_program *program + const struct gl_vertex_program *program = ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : NULL; GLuint i, index; diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 5d64aa3d922..38dd24afe7a 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -1048,7 +1048,7 @@ static void cvp_emit_inst( struct compilation *cp, } } -static void free_tnl_data( struct vertex_program *program ) +static void free_tnl_data( struct gl_vertex_program *program ) { struct tnl_compiled_program *p = (struct tnl_compiled_program *) program->TnlData; if (p->compiled_func) @@ -1057,7 +1057,7 @@ static void free_tnl_data( struct vertex_program *program ) program->TnlData = NULL; } -static void compile_vertex_program( struct vertex_program *program, +static void compile_vertex_program( struct gl_vertex_program *program, GLboolean try_codegen ) { struct compilation cp; @@ -1226,7 +1226,7 @@ static INLINE void call_func( struct tnl_compiled_program *p, static GLboolean run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) { - const struct vertex_program *program; + const struct gl_vertex_program *program; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct arb_vp_machine *m = ARB_VP_MACHINE(stage); struct tnl_compiled_program *p; @@ -1399,7 +1399,7 @@ static void validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) { struct arb_vp_machine *m = ARB_VP_MACHINE(stage); - struct vertex_program *program; + struct gl_vertex_program *program; if (ctx->ShaderObjects._VertexShaderPresent) return; @@ -1532,11 +1532,11 @@ const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage = * string has been parsed. */ void -_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program) +_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program) { if (program->Target == GL_VERTEX_PROGRAM_ARB) { /* free any existing tnl data hanging off the program */ - struct vertex_program *vprog = (struct vertex_program *) program; + struct gl_vertex_program *vprog = (struct gl_vertex_program *) program; if (vprog->TnlData) { free_tnl_data(vprog); } diff --git a/src/mesa/tnl/t_vb_arbprogram.h b/src/mesa/tnl/t_vb_arbprogram.h index dab725d7f7a..58efaa4fb97 100644 --- a/src/mesa/tnl/t_vb_arbprogram.h +++ b/src/mesa/tnl/t_vb_arbprogram.h @@ -179,8 +179,8 @@ struct tnl_compiled_program { void (*compiled_func)( struct arb_vp_machine * ); /**< codegen'd program */ }; -void _tnl_program_string_change( struct vertex_program * ); -void _tnl_program_destroy( struct vertex_program * ); +void _tnl_program_string_change( struct gl_vertex_program * ); +void _tnl_program_destroy( struct gl_vertex_program * ); void _tnl_disassem_vba_insn( union instruction op ); diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 9b43aecea7f..36ee4b2f46a 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -75,7 +75,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) TNLcontext *tnl = TNL_CONTEXT(ctx); struct vp_stage_data *store = VP_STAGE_DATA(stage); struct vertex_buffer *VB = &tnl->vb; - struct vertex_program *program = ctx->VertexProgram.Current; + struct gl_vertex_program *program = ctx->VertexProgram.Current; GLuint i; if (ctx->ShaderObjects._VertexShaderPresent) diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 4387e066fcd..3a66a54715e 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -115,7 +115,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - const struct fragment_program *fp = ctx->FragmentProgram._Current; + const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; struct state_key *key = CALLOC_STRUCT(state_key); GLuint i; @@ -257,7 +257,7 @@ struct ureg { struct tnl_program { const struct state_key *state; - struct vertex_program *program; + struct gl_vertex_program *program; GLuint temp_in_use; GLuint temp_reserved; @@ -1388,7 +1388,7 @@ static void build_tnl_program( struct tnl_program *p ) static void create_new_program( const struct state_key *key, - struct vertex_program *program, + struct gl_vertex_program *program, GLuint max_temps) { struct tnl_program p; @@ -1493,7 +1493,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); struct state_key *key; GLuint hash; - const struct vertex_program *prev = ctx->VertexProgram._Current; + const struct gl_vertex_program *prev = ctx->VertexProgram._Current; if (ctx->VertexProgram._Enabled == GL_FALSE) { /* Grab all the relevent state and put it in a single structure: @@ -1503,7 +1503,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) /* Look for an already-prepared program for this state: */ - ctx->_TnlProgram = (struct vertex_program *) + ctx->_TnlProgram = (struct gl_vertex_program *) search_cache( tnl->vp_cache, hash, key, sizeof(*key) ); /* OK, we'll have to build a new one: @@ -1512,7 +1512,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) if (0) _mesa_printf("Build new TNL program\n"); - ctx->_TnlProgram = (struct vertex_program *) + ctx->_TnlProgram = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); create_new_program( key, ctx->_TnlProgram, @@ -1540,8 +1540,8 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) */ if (ctx->VertexProgram._Current != prev && ctx->Driver.BindProgram) - ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, (struct program *) - ctx->VertexProgram._Current); + ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, + (struct gl_program *) ctx->VertexProgram._Current); } void _tnl_ProgramCacheInit( GLcontext *ctx ) diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index 428fe12788a..dab422429a1 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -84,6 +84,6 @@ extern void _tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value ); extern void -_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program); +_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program); #endif