summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_render_t.c8
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c14
2 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
index 1625a87223f..db60b59c8fc 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
@@ -158,16 +158,16 @@ get_max_vertices(struct gl_context *ctx, const struct _mesa_index_buffer *ib,
unsigned max_out;
if (ib) {
- switch (ib->type) {
- case GL_UNSIGNED_INT:
+ switch (ib->index_size) {
+ case 4:
max_out = MAX_OUT_I32;
break;
- case GL_UNSIGNED_SHORT:
+ case 2:
max_out = MAX_OUT_I16;
break;
- case GL_UNSIGNED_BYTE:
+ case 1:
max_out = MAX_OUT_I16;
break;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index 51ffd5aef54..fdd135c5d7d 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -59,9 +59,19 @@ vbo_init_arrays(struct gl_context *ctx, const struct _mesa_index_buffer *ib,
GLboolean imm = (render->mode == IMM);
int i, attr;
- if (ib)
- nouveau_init_array(&render->ib, 0, 0, ib->count, ib->type,
+ if (ib) {
+ GLenum ib_type;
+
+ if (ib->index_size == 4)
+ ib_type = GL_UNSIGNED_INT;
+ else if (ib->index_size == 2)
+ ib_type = GL_UNSIGNED_SHORT;
+ else
+ ib_type = GL_UNSIGNED_BYTE;
+
+ nouveau_init_array(&render->ib, 0, 0, ib->count, ib_type,
ib->obj, ib->ptr, GL_TRUE, ctx);
+ }
FOR_EACH_BOUND_ATTR(render, i, attr) {
const struct gl_vertex_array *array = arrays[attr];