diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_render.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index a0375f9022..e6ed06a69d 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -382,7 +382,6 @@ GLboolean r300_run_vb_render(GLcontext *ctx, r300UpdateShaders(rmesa); if (rmesa->state.VB.LockCount == 0 || 1) { - r300ReleaseArrays(ctx); r300EmitArrays(ctx, GL_FALSE); r300UpdateShaderStates(rmesa); @@ -446,6 +445,7 @@ GLboolean r300_run_vb_render(GLcontext *ctx, #ifdef USER_BUFFERS r300UseArrays(ctx); #endif + r300ReleaseArrays(ctx); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index 5ea9bb4eb4..8f7620482f 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -182,7 +182,7 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G unsigned int min = ~0, max = 0; struct tnl_prim prim; static void *ptr = NULL; - static struct r300_dma_region rvb; + struct r300_dma_region rvb; const GLvoid *indices = c_indices; if (count > 65535) { @@ -205,8 +205,8 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G return; FLUSH_CURRENT( ctx, 0 ); - r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); + memset(&rvb, 0, sizeof(rvb)); switch (type) { case GL_UNSIGNED_BYTE: for (i=0; i < count; i++) { @@ -311,8 +311,10 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G return; } } else { - if (setup_arrays(rmesa, min) >= R300_FALLBACK_TCL) + if (setup_arrays(rmesa, min) >= R300_FALLBACK_TCL) { + r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); goto fallback; + } rmesa->state.VB.Count = max - min + 1; } @@ -337,6 +339,7 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G if(rvb.buf) radeon_mm_use(rmesa, rvb.buf->id); + r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); return; fallback: @@ -355,7 +358,7 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei int elt_size; int i; void *ptr = NULL; - static struct r300_dma_region rvb; + struct r300_dma_region rvb; const GLvoid *indices = c_indices; if (count > 65535) { @@ -381,9 +384,9 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei #ifdef OPTIMIZE_ELTS min = 0; #endif - r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); - switch(type){ + memset(&rvb, 0, sizeof(rvb)); + switch (type){ case GL_UNSIGNED_BYTE: elt_size = 2; @@ -473,8 +476,10 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei return; }*/ } else { - if (setup_arrays(rmesa, min) >= R300_FALLBACK_TCL) + if (setup_arrays(rmesa, min) >= R300_FALLBACK_TCL) { + r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); goto fallback; + } rmesa->state.VB.Count = max - min + 1; } @@ -501,6 +506,7 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei if(rvb.buf) radeon_mm_use(rmesa, rvb.buf->id); + r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); return ; fallback: |