summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/r300/Makefile40
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c31
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c5
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertexprog.c153
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.c8
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.h9
-rw-r--r--src/mesa/drivers/dri/r300/radeon_ioctl.c3
-rw-r--r--src/mesa/drivers/dri/r300/radeon_lock.c8
-rw-r--r--src/mesa/drivers/dri/r300/radeon_lock.h11
-rw-r--r--src/mesa/drivers/dri/r300/radeon_screen.c6
12 files changed, 159 insertions, 121 deletions
diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile
index 9b9a0cf806..71454a37e9 100644
--- a/src/mesa/drivers/dri/r300/Makefile
+++ b/src/mesa/drivers/dri/r300/Makefile
@@ -38,30 +38,30 @@ DRIVER_SOURCES = \
r300_texprog.c \
r300_vertexprog.c \
r300_shader.c \
- r300_maos.c \
- \
- r200_context.c \
- r200_ioctl.c \
- r200_state.c \
- r200_state_init.c \
- r200_cmdbuf.c \
- r200_pixel.c \
- r200_tex.c \
- r200_texmem.c \
- r200_texstate.c \
- r200_tcl.c \
- r200_swtcl.c \
- r200_maos.c \
- r200_sanity.c \
- r200_vtxfmt.c \
- r200_vtxfmt_c.c \
- r200_vtxfmt_sse.c \
- r200_vtxfmt_x86.c
+ r300_maos.c
+# \
+# r200_context.c \
+# r200_ioctl.c \
+# r200_state.c \
+# r200_state_init.c \
+# r200_cmdbuf.c \
+# r200_pixel.c \
+# r200_tex.c \
+# r200_texmem.c \
+# r200_texstate.c \
+# r200_swtcl.c \
+# r200_maos.c \
+# r200_sanity.c \
+# r200_vtxfmt.c \
+# r200_vtxfmt_c.c \
+# r200_vtxfmt_sse.c \
+# r200_vtxfmt_x86.c
C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES)
-X86_SOURCES = r200_vtxtmp_x86.S
+X86_SOURCES =
+#r200_vtxtmp_x86.S
SYMLINKS = \
server/radeon_dri.c \
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 143cd22eb2..856445acf1 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -109,7 +109,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = {
/* Try and go straight to t&l
*/
- &_r300_tcl_stage,
+ //&_r300_tcl_stage,
/* Catch any t&l fallbacks
*/
@@ -293,7 +293,9 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
tcl_mode = driQueryOptioni(&r300->radeon.optionCache, "tcl_mode");
if (driQueryOptionb(&r300->radeon.optionCache, "no_rast")) {
fprintf(stderr, "disabling 3D acceleration\n");
+#if R200_MERGED
FALLBACK(&r300->radeon, RADEON_FALLBACK_DISABLE, 1);
+#endif
}
if (tcl_mode == DRI_CONF_TCL_SW ||
!(r300->radeon.radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 3653af9a5d..b5b75c8d85 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -658,7 +658,7 @@ do { \
if (1 || RADEON_DEBUG & DEBUG_FALLBACKS) \
fprintf(stderr, "%s: fallback:%s\n", \
__FUNCTION__, #expr); \
- stage->active = GL_FALSE; \
+ /*stage->active = GL_FALSE*/; \
return; \
} \
} while(0)
@@ -673,7 +673,7 @@ static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
/* We only support rendering in hardware for now */
if (ctx->RenderMode != GL_RENDER) {
- stage->active = GL_FALSE;
+ //stage->active = GL_FALSE;
return;
}
@@ -724,13 +724,15 @@ static void dtr(struct tnl_pipeline_stage *stage)
(void)stage;
}
+GLboolean r300_create_render(GLcontext *ctx, struct tnl_pipeline_stage *stage){
+ return GL_TRUE;
+}
+
+
const struct tnl_pipeline_stage _r300_render_stage = {
"r300 hw rasterize",
- _NEW_ALL, /* re-check (always re-check for now) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
+ NULL,
+ r300_create_render,
dtr, /* destructor */
r300_check_render, /* check */
r300_run_render /* run */
@@ -760,24 +762,21 @@ static void r300_check_tcl_render(GLcontext *ctx, struct tnl_pipeline_stage *sta
/* We only support rendering in hardware for now */
if (ctx->RenderMode != GL_RENDER) {
- stage->active = GL_FALSE;
+ //stage->active = GL_FALSE;
return;
}
if(VERTPROG_ACTIVE(ctx)) {
- stage->active = GL_TRUE;
- stage->inputs = ctx->VertexProgram.Current->InputsRead;
+ //stage->active = GL_TRUE;
+ //stage->inputs = ctx->VertexProgram.Current->InputsRead;
} else {
- stage->active = GL_FALSE;
+ //stage->active = GL_FALSE;
}
}
const struct tnl_pipeline_stage _r300_tcl_stage = {
"r300 tcl",
- _NEW_ALL, /* re-check (always re-check for now) */
- 0, /* re-run (always runs) */
- GL_TRUE, /* active */
- 0, 0, /* inputs (set in check_render), outputs */
- 0, 0, /* changed_inputs, private */
+ NULL,
+ r300_create_render,
dtr, /* destructor */
r300_check_tcl_render, /* check */
r300_run_tcl_render /* run */
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index f998eb8cad..7a0f8bc87e 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -526,7 +526,9 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state)
~R300_RB3D_STENCIL_ENABLE;
}
} else {
+#if R200_MERGED
FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state);
+#endif
}
break;
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index ccdf2a49b9..55d8254890 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -1302,7 +1302,10 @@ static GLboolean update_tex_common(GLcontext * ctx, int unit)
}
}
+#if R200_MERGED
FALLBACK(&rmesa->radeon, RADEON_FALLBACK_BORDER_MODE, t->border_fallback);
+#endif
+
return !t->border_fallback;
}
@@ -1351,7 +1354,9 @@ void r300UpdateTextureState(GLcontext * ctx)
r300UpdateTextureUnit(ctx, 7)
);
+#if R200_MERGED
FALLBACK(&rmesa->radeon, RADEON_FALLBACK_TEXTURE, !ok);
+#endif
/* This needs correction, or just be done elsewhere
if (rmesa->radeon.TclFallback)
diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c
index f972326a13..4b73c2fd1c 100644
--- a/src/mesa/drivers/dri/r300/r300_vertexprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c
@@ -174,7 +174,7 @@ void dump_program_params(GLcontext *ctx, struct vertex_program *vp)
fprintf(stderr, "{ ");
for(i=0; i < 4; i++)
- fprintf(stderr, "%f ", vp->Parameters->Parameters[pi].Values[i]);
+ fprintf(stderr, "%f ", vp->Parameters->ParameterValues[pi][i]);
fprintf(stderr, "}\n");
}
@@ -212,7 +212,7 @@ static void debug_vp(GLcontext *ctx, struct vertex_program *vp)
fprintf(stderr, "%d.", vpi->DstReg.Index);
for(i=0; i < 4; i++)
- if(vpi->DstReg.WriteMask[i])
+ if(vpi->DstReg.WriteMask & (1<<i))
fprintf(stderr, "%s", dst_mask_names[i]);
fprintf(stderr, " ");
@@ -230,8 +230,8 @@ static void debug_vp(GLcontext *ctx, struct vertex_program *vp)
}
fprintf(stderr, "%d.", vpi->SrcReg[operand_index].Index);
- for(i=0; i < 4; i++)
- fprintf(stderr, "%s", dst_mask_names[vpi->SrcReg[operand_index].Swizzle[i]]);
+ /*for(i=0; i < 4; i++)
+ fprintf(stderr, "%s", dst_mask_names[vpi->SrcReg[operand_index].Swizzle[i]]);*/
if(operand_index+1 < (op_names[operator_index].ip & (~FLAG_MASK)) )
fprintf(stderr, ",");
@@ -262,10 +262,10 @@ void r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp)
case NAMED_PARAMETER:
//fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
case CONSTANT:
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->Parameters[pi].Values[0];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->Parameters[pi].Values[1];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->Parameters[pi].Values[2];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->Parameters[pi].Values[3];
+ vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][0];
+ vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][1];
+ vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][2];
+ vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][3];
break;
default: _mesa_problem(NULL, "Bad param type in %s", __FUNCTION__);
@@ -276,14 +276,14 @@ void r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp)
vp->params.length=dst_index;
}
-static unsigned long t_dst_mask(GLboolean *mask)
+static unsigned long t_dst_mask(GLuint mask)
{
unsigned long flags=0;
- if(mask[0]) flags |= VSF_FLAG_X;
- if(mask[1]) flags |= VSF_FLAG_Y;
- if(mask[2]) flags |= VSF_FLAG_Z;
- if(mask[3]) flags |= VSF_FLAG_W;
+ if(mask & WRITEMASK_X) flags |= VSF_FLAG_X;
+ if(mask & WRITEMASK_Y) flags |= VSF_FLAG_Y;
+ if(mask & WRITEMASK_Z) flags |= VSF_FLAG_Z;
+ if(mask & WRITEMASK_W) flags |= VSF_FLAG_W;
return flags;
}
@@ -345,13 +345,12 @@ static unsigned long t_src_class(enum register_file file)
static unsigned long t_swizzle(GLubyte swizzle)
{
switch(swizzle){
- case 0: return VSF_IN_COMPONENT_X;
- case 1: return VSF_IN_COMPONENT_Y;
- case 2: return VSF_IN_COMPONENT_Z;
- case 3: return VSF_IN_COMPONENT_W;
-
- case SWIZZLE_ZERO:
- case SWIZZLE_ONE:
+ case SWIZZLE_X: return VSF_IN_COMPONENT_X;
+ case SWIZZLE_Y: return VSF_IN_COMPONENT_Y;
+ case SWIZZLE_Z: return VSF_IN_COMPONENT_Z;
+ case SWIZZLE_W: return VSF_IN_COMPONENT_W;
+ case SWIZZLE_ZERO: return VSF_IN_COMPONENT_ZERO;
+ case SWIZZLE_ONE: return VSF_IN_COMPONENT_ONE;
default:
fprintf(stderr, "problem in %s", __FUNCTION__);
exit(0);
@@ -401,10 +400,10 @@ static unsigned long t_src(struct r300_vertex_program *vp, struct vp_src_registe
{
return MAKE_VSF_SOURCE(t_src_index(vp, src),
- t_swizzle(src->Swizzle[0]),
- t_swizzle(src->Swizzle[1]),
- t_swizzle(src->Swizzle[2]),
- t_swizzle(src->Swizzle[3]),
+ t_swizzle(GET_SWZ(src->Swizzle, 0)),
+ t_swizzle(GET_SWZ(src->Swizzle, 1)),
+ t_swizzle(GET_SWZ(src->Swizzle, 2)),
+ t_swizzle(GET_SWZ(src->Swizzle, 3)),
t_src_class(src->File),
src->Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
}
@@ -413,10 +412,10 @@ static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct vp_src_
{
return MAKE_VSF_SOURCE(t_src_index(vp, src),
- t_swizzle(src->Swizzle[0]),
- t_swizzle(src->Swizzle[0]),
- t_swizzle(src->Swizzle[0]),
- t_swizzle(src->Swizzle[0]),
+ t_swizzle(GET_SWZ(src->Swizzle, 0)),
+ t_swizzle(GET_SWZ(src->Swizzle, 0)),
+ t_swizzle(GET_SWZ(src->Swizzle, 0)),
+ t_swizzle(GET_SWZ(src->Swizzle, 0)),
t_src_class(src->File),
src->Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
}
@@ -630,17 +629,17 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[1]),
- t_swizzle(src[0].Swizzle[2]),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
SWIZZLE_ZERO,
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(src[1].Swizzle[0]),
- t_swizzle(src[1].Swizzle[1]),
- t_swizzle(src[1].Swizzle[2]),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
SWIZZLE_ZERO,
t_src_class(src[1].File),
src[1].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
@@ -654,10 +653,10 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
o_inst->src1=t_src(vp, &src[0]);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(src[1].Swizzle[0]),
- t_swizzle(src[1].Swizzle[1]),
- t_swizzle(src[1].Swizzle[2]),
- t_swizzle(src[1].Swizzle[3]),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
+ t_swizzle(GET_SWZ(src[1].Swizzle, 3)),
t_src_class(src[1].File),
(!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src3=0;
@@ -669,10 +668,10 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
o_inst->src1=t_src(vp, &src[0]);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[1]),
- t_swizzle(src[0].Swizzle[2]),
- t_swizzle(src[0].Swizzle[3]),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)),
t_src_class(src[0].File),
(!src[0].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src3=0;
@@ -712,10 +711,10 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[0]),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src2=0;
@@ -727,24 +726,24 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
/* NOTE: Users swizzling might not work. */
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[0]), // x
- t_swizzle(src[0].Swizzle[3]), // w
- t_swizzle(src[0].Swizzle[2]), // z
- t_swizzle(src[0].Swizzle[1]), // y
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[1]), // y
- t_swizzle(src[0].Swizzle[3]), // w
- t_swizzle(src[0].Swizzle[2]), // z
- t_swizzle(src[0].Swizzle[0]), // x
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[1]), // y
- t_swizzle(src[0].Swizzle[0]), // x
- t_swizzle(src[0].Swizzle[2]), // z
- t_swizzle(src[0].Swizzle[3]), // w
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
goto next;
@@ -754,9 +753,9 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[0]),
- t_swizzle(src[0].Swizzle[1]),
- t_swizzle(src[0].Swizzle[2]),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
VSF_IN_COMPONENT_ONE,
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
@@ -774,18 +773,18 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[1]), // y
- t_swizzle(src[0].Swizzle[2]), // z
- t_swizzle(src[0].Swizzle[0]), // x
- t_swizzle(src[0].Swizzle[3]), // w
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(src[1].Swizzle[2]), // z
- t_swizzle(src[1].Swizzle[0]), // x
- t_swizzle(src[1].Swizzle[1]), // y
- t_swizzle(src[1].Swizzle[3]), // w
+ t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
t_src_class(src[1].File),
src[1].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
@@ -801,18 +800,18 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(src[1].Swizzle[1]), // y
- t_swizzle(src[1].Swizzle[2]), // z
- t_swizzle(src[1].Swizzle[0]), // x
- t_swizzle(src[1].Swizzle[3]), // w
+ t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
t_src_class(src[1].File),
(!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(src[0].Swizzle[2]), // z
- t_swizzle(src[0].Swizzle[0]), // x
- t_swizzle(src[0].Swizzle[1]), // y
- t_swizzle(src[0].Swizzle[3]), // w
+ t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
+ t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
+ t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
+ t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
t_src_class(src[0].File),
src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c
index b2cb9cfb5f..a82070c561 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.c
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
@@ -270,11 +270,13 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
driDrawableInitVBlank(driDrawPriv,
radeon->vblank_flags);
radeon->dri.drawable = driDrawPriv;
-
+
+#if R200_MERGED
if (IS_FAMILY_R200(radeon)) {
r200UpdateWindow(radeon->glCtx);
r200UpdateViewportOffset(radeon->glCtx);
}
+#endif
}
_mesa_make_current2(radeon->glCtx,
@@ -290,9 +292,11 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
_mesa_update_state(radeon->glCtx);
+#if R200_MERGED
if (IS_FAMILY_R200(radeon))
r200ValidateState(radeon->glCtx);
-
+#endif
+
} else {
if (RADEON_DEBUG & DEBUG_DRI)
fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h
index f0e10dd805..84fcaee718 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.h
+++ b/src/mesa/drivers/dri/r300/radeon_context.h
@@ -80,6 +80,7 @@ static __inline GLuint radeonPackColor(GLuint cpp,
#define RADEON_FALLBACK_DISABLE 0x40
#define RADEON_FALLBACK_BORDER_MODE 0x80
+#if R200_MERGED
extern void radeonFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
#define FALLBACK( radeon, bit, mode ) do { \
@@ -87,7 +88,9 @@ extern void radeonFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
__FUNCTION__, bit, mode ); \
radeonFallback( (radeon)->glCtx, bit, mode ); \
} while (0)
-
+#else
+#define FALLBACK( radeon, bit, mode ) fprintf(stderr, "%s:%s\n", __LINE__, __FILE__);
+#endif
/* TCL fallbacks */
extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
@@ -106,7 +109,11 @@ extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
#define RADEON_TCL_FALLBACK_BITMAP 0x0800 /* draw bitmap with points */
#define RADEON_TCL_FALLBACK_VERTEX_PROGRAM 0x1000 /* vertex program active */
+#if R200_MERGED
#define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode )
+#else
+#define TCL_FALLBACK( ctx, bit, mode ) ;
+#endif
struct radeon_dri_mirror {
diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c
index f75b755184..f79f32d4a6 100644
--- a/src/mesa/drivers/dri/r300/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c
@@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "macros.h"
#include "context.h"
#include "swrast/swrast.h"
-
#include "r200_context.h"
#include "r300_context.h"
#include "r200_state.h"
@@ -329,8 +328,10 @@ void radeonFlush(GLcontext * ctx)
if (IS_FAMILY_R300(radeon))
r300Flush(ctx);
+#if R200_MERGED
else
r200Flush(ctx);
+#endif
}
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c
index 4579bc4ac4..7468bce012 100644
--- a/src/mesa/drivers/dri/r300/radeon_lock.c
+++ b/src/mesa/drivers/dri/r300/radeon_lock.c
@@ -68,6 +68,7 @@ static void radeonUpdatePageFlipping(radeonContextPtr radeon)
/**
* Called by radeonGetLock() after the lock has been obtained.
*/
+#if R200_MERGED
static void r200RegainedLock(r200ContextPtr r200)
{
__DRIdrawablePrivate *dPriv = r200->radeon.dri.drawable;
@@ -94,6 +95,7 @@ static void r200RegainedLock(r200ContextPtr r200)
DRI_AGE_TEXTURES(r200->texture_heaps[i]);
}
}
+#endif
static void r300RegainedLock(radeonContextPtr radeon)
{
@@ -111,7 +113,7 @@ static void r300RegainedLock(radeonContextPtr radeon)
radeon->lastStamp = dPriv->lastStamp;
}
-#if 0
+#if R200_MERGED
for (i = 0; i < r200->nr_heaps; i++) {
DRI_AGE_TEXTURES(r200->texture_heaps[i]);
}
@@ -149,8 +151,10 @@ void radeonGetLock(radeonContextPtr radeon, GLuint flags)
if (IS_FAMILY_R300(radeon))
r300RegainedLock(radeon);
+#if R200_MERGED
else
r200RegainedLock((r200ContextPtr)radeon);
-
+#endif
+
radeon->lost_context = GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h
index 3359d7822c..c9acbce0c3 100644
--- a/src/mesa/drivers/dri/r300/radeon_lock.h
+++ b/src/mesa/drivers/dri/r300/radeon_lock.h
@@ -96,6 +96,7 @@ extern int prevLockLine;
DEBUG_LOCK(); \
} while (0)
+#if R200_MERGED
#define UNLOCK_HARDWARE( radeon ) \
do { \
DRM_UNLOCK( (radeon)->dri.fd, \
@@ -109,5 +110,13 @@ extern int prevLockLine;
__r200->save_on_next_unlock = GL_FALSE; \
} \
} while (0)
-
+#else
+#define UNLOCK_HARDWARE( radeon ) \
+ do { \
+ DRM_UNLOCK( (radeon)->dri.fd, \
+ (radeon)->dri.hwLock, \
+ (radeon)->dri.hwContext ); \
+ DEBUG_RESET(); \
+ } while (0)
+#endif
#endif /* __RADEON_LOCK_H__ */
diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c
index f7d7a2f04e..436fa76c46 100644
--- a/src/mesa/drivers/dri/r300/radeon_screen.c
+++ b/src/mesa/drivers/dri/r300/radeon_screen.c
@@ -591,6 +591,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
(*glx_enable_extension) (psc,
"GLX_MESA_swap_frame_usage");
+#if R200_MERGED
if (driCompareGLXAPIVersion(20030818) >= 0) {
sPriv->psc->allocateMemory =
(void *)r200AllocateMemoryMESA;
@@ -602,6 +603,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
(*glx_enable_extension) (psc,
"GLX_MESA_allocate_memory");
}
+#endif
if (driCompareGLXAPIVersion(20030915) >= 0) {
(*glx_enable_extension) (psc,
@@ -696,8 +698,10 @@ static GLboolean radeonCreateContext(const __GLcontextModes * glVisual,
if (chip >= RADEON_CHIP_R300)
return r300CreateContext(glVisual, driContextPriv, sharedContextPriv);
+#if R200_MERGED
else
return r200CreateContext(glVisual, driContextPriv, sharedContextPriv);
+#endif
}
@@ -711,8 +715,10 @@ static void radeonDestroyContext(__DRIcontextPrivate * driContextPriv)
if (chip >= RADEON_CHIP_R300)
return r300DestroyContext(driContextPriv);
+#if R200_MERGED
else
return r200DestroyContext(driContextPriv);
+#endif
}