aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_draw_upload.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-01-08 16:20:28 -0800
committerEric Anholt <[email protected]>2008-01-09 14:41:38 -0800
commit5a49e84fcd858a1ad9c0ad839ccbe93504593cd0 (patch)
treedbcce4f71d6f6491e78d1a395177b711397d233b /src/mesa/drivers/dri/i965/brw_draw_upload.c
parent8c4806ccc4d24b78fe2a2a7119333b965572e948 (diff)
[965] Clarify a bit of index buffer upload code.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_draw_upload.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index b0042a5449d..8c4e1bd5690 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -583,7 +583,10 @@ void brw_upload_indices( struct brw_context *brw,
index_buffer->ptr,
bufferobj);
} else {
- if (((1 << get_index_type(index_buffer->type)) - 1) & offset) {
+ /* If the index buffer isn't aligned to its element size, we have to
+ * rebase it into a temporary.
+ */
+ if ((get_size(index_buffer->type) - 1) & offset) {
struct gl_buffer_object *vbo;
GLuint voffset;
GLubyte *map = ctx->Driver.MapBuffer(ctx,