summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_render.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2009-06-04 08:42:29 +0200
committerDave Airlie <[email protected]>2009-06-07 16:40:09 +1000
commite2aedfa62079ff1a333e1f4e56faea303cc36edb (patch)
treef7ed595c27a397c3a72536a914910741a3f93c57 /src/mesa/drivers/dri/r300/r300_render.c
parent58982f8af1496c4860fb7bf3e815977ed4a753ff (diff)
r300: Endianness fixes for recent vertex path changes.
Signed-off-by: Maciej Cencora <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_render.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index adda92467a6..dfbd79a3895 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -176,15 +176,15 @@ static void r300EmitElts(GLcontext * ctx, unsigned long n_elts)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
void *out;
- GLbyte el_size;
+ GLuint size;
- el_size = rmesa->ind_buf.is_32bit ? 4 : 2;
+ size = ((rmesa->ind_buf.is_32bit ? 4 : 2) * n_elts + 3) & ~3;
radeonAllocDmaRegion(&rmesa->radeon, &rmesa->radeon.tcl.elt_dma_bo,
- &rmesa->radeon.tcl.elt_dma_offset, n_elts * el_size, 4);
+ &rmesa->radeon.tcl.elt_dma_offset, size, 4);
radeon_bo_map(rmesa->radeon.tcl.elt_dma_bo, 1);
out = rmesa->radeon.tcl.elt_dma_bo->ptr + rmesa->radeon.tcl.elt_dma_offset;
- memcpy(out, rmesa->ind_buf.ptr, n_elts * el_size);
+ memcpy(out, rmesa->ind_buf.ptr, size);
radeon_bo_unmap(rmesa->radeon.tcl.elt_dma_bo);
}