summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-07-20 16:49:57 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-07-20 16:49:57 +0000
commit122629f27925a9dc50029bebc5079f87f416a7e1 (patch)
treef8800f9e5f4fff6bbd6c6496d5c74f8685b63372 /src/mesa/drivers
parent459db7bd72131e63ed7687956819c4d0520972dd (diff)
Some structure renaming. Prefix vertex/fragment-related structs with
"gl_" to match other structs.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.h2
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c16
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h2
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c27
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h6
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c10
-rw-r--r--src/mesa/drivers/dri/r300/r300_program.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_shader.c20
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertexprog.c8
10 files changed, 52 insertions, 43 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h
index a088c087b6..761a475714 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 5cd6ea4de5..b0cc59c306 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 e1a53212a5..cf1673b429 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 df5c9f848a..0f646bf30b 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 00c236e839..eaed68e7c8 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 e1d5b08580..c70a47215d 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 61efdec6a8..4a13b36e64 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<<attr))) {
@@ -1035,7 +1035,7 @@ static pfs_reg_t get_attrib(struct r300_fragment_program *rp, GLuint attr)
static GLboolean parse_program(struct r300_fragment_program *rp)
{
- struct fragment_program *mp = &rp->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 3defe106c2..3210660df1 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 0c5596159d..576b18953f 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 c62a5863eb..45b419d04e 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