From: Aapo Tahkola Date: Mon, 18 Apr 2005 22:41:43 +0000 (+0000) Subject: Fixing and enabling elt buffers by default. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8ed0aa26804558cb732f6ea41fe0ebe3da91efe;p=mesa.git Fixing and enabling elt buffers by default. --- diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 4decd1e6a20..22c47d6915c 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -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) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 894d3d1b904..3653af9a5d6 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -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 ? */ diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 7cc0990444c..f998eb8cad6 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -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