Mesa (nvc0): nvc0: fix index size method value for u8 indices
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Tue Jan 4 15:19:46 UTC 2011
Module: Mesa
Branch: nvc0
Commit: 4884ca5f67a0138659e48700e8b2f8821400c995
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4884ca5f67a0138659e48700e8b2f8821400c995
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Tue Jan 4 16:16:52 2011 +0100
nvc0: fix index size method value for u8 indices
---
src/gallium/drivers/nvc0/nvc0_vbo.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo.c b/src/gallium/drivers/nvc0/nvc0_vbo.c
index 15a4397..46f67c8 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo.c
@@ -450,7 +450,7 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
struct nouveau_channel *chan = nvc0->screen->base.channel;
void *data;
unsigned prim;
- unsigned index_size = nvc0->idxbuf.index_size;
+ const unsigned index_size = nvc0->idxbuf.index_size;
chan->flush_notify = nvc0_draw_vbo_flush_notify;
chan->user_private = nvc0;
@@ -468,12 +468,6 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
unsigned offset = nvc0->idxbuf.offset;
unsigned limit = nvc0->idxbuf.buffer->width0 - 1;
- if (index_size == 4)
- index_size = 2;
- else
- if (index_size == 2)
- index_size = 1;
-
nvc0_buffer_adjust_score(nvc0, res, 1);
while (instance_count--) {
@@ -485,7 +479,7 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
OUT_RESRCl(chan, res, offset, NOUVEAU_BO_RD);
OUT_RESRCh(chan, res, limit, NOUVEAU_BO_RD);
OUT_RESRCl(chan, res, limit, NOUVEAU_BO_RD);
- OUT_RING (chan, index_size);
+ OUT_RING (chan, index_size >> 1);
OUT_RING (chan, start);
OUT_RING (chan, count);
IMMED_RING(chan, RING_3D(VERTEX_END_GL), 0);
More information about the mesa-commit
mailing list