don't use hw to perform vertex transform etc. when using swtcl. This for compatibilit...
authorAapo Tahkola <aapo@aapo-desktop.(none)>
Sat, 5 May 2007 14:07:46 +0000 (17:07 +0300)
committerAapo Tahkola <aapo@aapo-desktop.(none)>
Sat, 5 May 2007 14:07:46 +0000 (17:07 +0300)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c

index c8b81d9849755ba0ab13bb647542bbdeb6545615..da253ba67024996350efc64a30517f6d56679a88 100644 (file)
@@ -576,11 +576,6 @@ struct r300_vertex_shader_fragment {
 struct r300_vertex_shader_state {
        struct r300_vertex_shader_fragment program;
 
-       /* a bit of a waste - each uses only a subset of allocated space..
-           but easier to program */
-       struct r300_vertex_shader_fragment matrix[3];
-       struct r300_vertex_shader_fragment vector[2];
-
        struct r300_vertex_shader_fragment unknown1;
        struct r300_vertex_shader_fragment unknown2;
 
index 4730fdff7496612c64b48432584ae67367f3b391..a1e2d529b60c3518106459e0a38e5c2453e9fe46 100644 (file)
@@ -1568,13 +1568,6 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
        r300->state.vertex_shader.unknown_ptr2=0x0; /* magic value */
        r300->state.vertex_shader.unknown_ptr3=0x4; /* magic value */
 
-       /* Initialize matrix and vector parameters.. these should really be restructured */
-       /* TODO: fix vertex_shader structure */
-       r300->state.vertex_shader.matrix[0].length=16;
-       r300->state.vertex_shader.matrix[1].length=0;
-       r300->state.vertex_shader.matrix[2].length=0;
-       r300->state.vertex_shader.vector[0].length=0;
-       r300->state.vertex_shader.vector[1].length=0;
        r300->state.vertex_shader.unknown1.length=0;
        r300->state.vertex_shader.unknown2.length=0;
 
@@ -1586,48 +1579,11 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
        r300->state.vertex_shader.program_end++; \
        }
 
-       /* Multiply vertex coordinates with transform matrix */
-
-       WRITE_OP(
-               EASY_VSF_OP(MUL, 0, ALL, TMP),
-               VSF_PARAM(3),
-               VSF_ATTR_W(0),
-               EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE)
-               )
-
-       WRITE_OP(
-               EASY_VSF_OP(MUL, 1, ALL, RESULT),
-               VSF_REG(1),
-               VSF_ATTR_UNITY(1),
-               VSF_UNITY(1)
-               )
-
-       WRITE_OP(
-               EASY_VSF_OP(MAD, 0, ALL, TMP),
-               VSF_PARAM(2),
-               VSF_ATTR_Z(0),
-               VSF_TMP(0)
-               )
-
-       WRITE_OP(
-               EASY_VSF_OP(MAD, 0, ALL, TMP),
-               VSF_PARAM(1),
-               VSF_ATTR_Y(0),
-               VSF_TMP(0)
-               )
-
-       WRITE_OP(
-               EASY_VSF_OP(MAD, 0, ALL, RESULT),
-               VSF_PARAM(0),
-               VSF_ATTR_X(0),
-               VSF_TMP(0)
-               )
-       o_reg += 2;
-
-       for (i = VERT_ATTRIB_COLOR1; i < VERT_ATTRIB_MAX; i++)
+
+       for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++)
                if (r300->state.sw_tcl_inputs[i] != -1) {
                        WRITE_OP(
-                               EASY_VSF_OP(MUL, o_reg++ /* 2+i */, ALL, RESULT),
+                               EASY_VSF_OP(MUL, o_reg++, ALL, RESULT),
                                VSF_REG(r300->state.sw_tcl_inputs[i]),
                                VSF_ATTR_UNITY(r300->state.sw_tcl_inputs[i]),
                                VSF_UNITY(r300->state.sw_tcl_inputs[i])
@@ -1666,20 +1622,8 @@ void r300SetupVertexShader(r300ContextPtr rmesa)
        /* This needs to be replaced by vertex shader generation code */
        r300GenerateSimpleVertexShader(rmesa);
 
-        rmesa->state.vertex_shader.matrix[0].length=16;
-        memcpy(rmesa->state.vertex_shader.matrix[0].body.f, ctx->_ModelProjectMatrix.m, 16*4);
-
        setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program));
 
-       setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX0, &(rmesa->state.vertex_shader.matrix[0]));
-#if 0
-       setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX1, &(rmesa->state.vertex_shader.matrix[0]));
-       setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX2, &(rmesa->state.vertex_shader.matrix[0]));
-
-       setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR0, &(rmesa->state.vertex_shader.vector[0]));
-       setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR1, &(rmesa->state.vertex_shader.vector[1]));
-#endif
-
 #if 0
        setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1));
        setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2));
index 0625e5bc571c7e25be5ea46e8665bc031356d99e..9a5173cad1aa10609cd8495696ccab26494e548d 100644 (file)
@@ -68,7 +68,13 @@ void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, st
        
        rvb->Count = vb->Count;
        
-       CONV_VB(VERT_ATTRIB_POS, ObjPtr);
+       if (hw_tcl_on) {
+               CONV_VB(VERT_ATTRIB_POS, ObjPtr);
+       } else {
+               assert(vb->ClipPtr);
+               CONV_VB(VERT_ATTRIB_POS, ClipPtr);
+       }       
+       
        CONV_VB(VERT_ATTRIB_NORMAL, NormalPtr);
        CONV_VB(VERT_ATTRIB_COLOR0, ColorPtr[0]);
        CONV_VB(VERT_ATTRIB_COLOR1, SecondaryColorPtr[0]);