Fixing and enabling elt buffers by default.
authorAapo Tahkola <aet@rasterburn.org>
Mon, 18 Apr 2005 22:41:43 +0000 (22:41 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Mon, 18 Apr 2005 22:41:43 +0000 (22:41 +0000)
src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c

index 4decd1e6a204e6b33e89ff9de4b7f813b25fd026..22c47d6915cd8451ce16fa3811ee0f248b1a4c12 100644 (file)
@@ -218,15 +218,12 @@ void r300EmitElts(GLcontext * ctx, GLuint *elts, unsigned long n_elts)
        unsigned short int *out;
        int i;
        
-       r300AllocDmaRegion(rmesa, rvb, (n_elts+1)*2 , 0x20);
+       r300AllocDmaRegion(rmesa, rvb, n_elts*sizeof(unsigned short int), 2);
        
        out = (unsigned short int *)(rvb->address + rvb->start);
        
        for(i=0; i < n_elts; i++)
                out[i]=(unsigned short int)elts[i];
-       
-       if(n_elts & 1)
-               out[i]=0;
 }
 
 /* Emit vertex data to GART memory (unless immediate mode)
index 894d3d1b904eece06c6c819b9a98c994ccb2ce5b..3653af9a5d6838fc989fdab59aa68af213dd81ab 100644 (file)
@@ -466,18 +466,22 @@ static void inline fire_EB(PREFIX unsigned long addr, int vertex_count, int type
        LOCAL_VARS
        unsigned long addr_a;
        
-       addr_a = addr & 0x1c;
+       if(addr & 1){
+               WARN_ONCE("Badly aligned buffer\n");
+               return ;
+       }
+       addr_a = 0; /*addr & 0x1c;*/
        
        check_space(6);
        
        start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0);
-       /* TODO: Check if R300_VAP_VF_CNTL__INDEX_SIZE_32bit works. */
+       /* TODO: R300_VAP_VF_CNTL__INDEX_SIZE_32bit . */
        e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count<<16) | type);
 
        start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2);
        e32(R300_EB_UNK1 | (addr_a << 16) | R300_EB_UNK2);
-       e32(addr & 0xffffffe3);
-       e32((vertex_count+1)/2 + addr_a/4);
+       e32(addr /*& 0xffffffe3*/);
+       e32((vertex_count+1)/2 /*+ addr_a/4*/); /* Total number of dwords needed? */
 }
 
 static void r300_render_vb_primitive(r300ContextPtr rmesa,
@@ -500,7 +504,7 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa,
 
    if(rmesa->state.Elts){
        r300EmitAOS(rmesa, rmesa->state.aos_count, 0);
-#if 1
+#if 0
        start_index32_packet(num_verts, type);
        for(i=0; i < num_verts; i++)
                e32(rmesa->state.Elts[start+i]); /* start ? */
index 7cc0990444c1e09d558a6805b018b727866aa322..f998eb8cad65128ba605154f3c1582fa961ad9c3 100644 (file)
@@ -2126,7 +2126,7 @@ void r300ResetHwState(r300ContextPtr r300)
                /* Initialize magic registers
                 TODO : learn what they really do, or get rid of
                 those we don't have to touch */
-       r300->hw.unk2080.cmd[1] = 0x0030045A;
+       r300->hw.unk2080.cmd[1] = 0x0030045A; /* Dangerous */
 
        r300->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
                                | R300_VPORT_X_OFFSET_ENA