Modifying to build against current Mesa. Disabled r200*.c files since they didnt...
authorAapo Tahkola <aet@rasterburn.org>
Sun, 24 Apr 2005 09:08:31 +0000 (09:08 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Sun, 24 Apr 2005 09:08:31 +0000 (09:08 +0000)
12 files changed:
src/mesa/drivers/dri/r300/Makefile
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_texstate.c
src/mesa/drivers/dri/r300/r300_vertexprog.c
src/mesa/drivers/dri/r300/radeon_context.c
src/mesa/drivers/dri/r300/radeon_context.h
src/mesa/drivers/dri/r300/radeon_ioctl.c
src/mesa/drivers/dri/r300/radeon_lock.c
src/mesa/drivers/dri/r300/radeon_lock.h
src/mesa/drivers/dri/r300/radeon_screen.c

index 9b9a0cf806045636942e4e500d3cc5d996cfc71c..71454a37e99c4393586203fbcf94221205719c17 100644 (file)
@@ -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 \
index 143cd22eb2f9916ca656810651d5f7bd80139c7b..856445acf1aace3b3011207f4342ffbccd85db45 100644 (file)
@@ -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)) {
index 3653af9a5d6838fc989fdab59aa68af213dd81ab..b5b75c8d85b6010825938ae36469a3d3a65e8341 100644 (file)
@@ -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 */
index f998eb8cad65128ba605154f3c1582fa961ad9c3..7a0f8bc87ea41ea5432adebf90d84188bbb4975f 100644 (file)
@@ -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;
 
index ccdf2a49b9531bcb2e35c3ae460ad59dad43db3e..55d82548901c8674b592ee6982f88bb46feb16f2 100644 (file)
@@ -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)
index f972326a13b1194242b3e96b3c0e6881b626735b..4b73c2fd1cca8df01762d251172ceca1ccc90bf2 100644 (file)
@@ -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);
                        
index b2cb9cfb5f459b15f4574320469647479c00f4e7..a82070c5611912f801d809496a9a7bbd8b8dbec6 100644 (file)
@@ -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__);
index f0e10dd8053cd6aabb00ad1809f3b65911bccc7f..84fcaee718192cf5ff70803d269d3718ca074ffa 100644 (file)
@@ -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 {
index f75b75518431ae2c4e40fea0896f9b52ff185f3f..f79f32d4a613c0d399de4868365cda3d328c9631 100644 (file)
@@ -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 
 }
 
 
index 4579bc4ac4039ff9a4c256043cfa9bca2992369d..7468bce01289ce28ba67462bbcd195656f3f15c4 100644 (file)
@@ -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;
 }
index 3359d7822c0c76993a9c066f8b3fc0ec5460c44b..c9acbce0c3272ca3dfc63aaf910e313f99a7a220 100644 (file)
@@ -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__ */
index f7d7a2f04ebf674e93c9299e73bdb0171a1d623a..436fa76c46f5f84222d116b7cce3c3067b465ab2 100644 (file)
@@ -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
 }