summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2017-04-02 19:07:49 +0200
committerMarek Olšák <marek.olsak@amd.com>2017-04-22 22:51:15 +0200
commit070072ad43bb41624d271f10697ea21a776b1ec1 (patch)
tree2f88efd83530f8a71e4dec1634378020a8826565 /src/mesa/tnl/t_draw.c
parente137b9eed9501858e2037719a94aafee35179249 (diff)
mesa: replace _mesa_index_buffer::type with index_size
This avoids repeated translations of the enum. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/tnl/t_draw.c')
-rw-r--r--src/mesa/tnl/t_draw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 24d74c0e1f1..9fca4da1f4d 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -358,7 +358,7 @@ static void bind_indices( struct gl_context *ctx,
bo[*nr_bo] = ib->obj;
(*nr_bo)++;
ptr = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr,
- ib->count * vbo_sizeof_ib_type(ib->type),
+ ib->count * ib->index_size,
GL_MAP_READ_BIT, ib->obj,
MAP_INTERNAL);
assert(ib->obj->Mappings[MAP_INTERNAL].Pointer);
@@ -367,19 +367,19 @@ static void bind_indices( struct gl_context *ctx,
ptr = ADD_POINTERS(ib->obj->Mappings[MAP_INTERNAL].Pointer, ib->ptr);
}
- if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) {
+ if (ib->index_size == 4 && VB->Primitive[0].basevertex == 0) {
VB->Elts = (GLuint *) ptr;
}
else {
GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint));
VB->Elts = elts;
- if (ib->type == GL_UNSIGNED_INT) {
+ if (ib->index_size == 4) {
const GLuint *in = (GLuint *)ptr;
for (i = 0; i < ib->count; i++)
*elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
}
- else if (ib->type == GL_UNSIGNED_SHORT) {
+ else if (ib->index_size == 2) {
const GLushort *in = (GLushort *)ptr;
for (i = 0; i < ib->count; i++)
*elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;