diff options
author | Eric Anholt <eric@anholt.net> | 2013-01-22 17:14:15 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-01-25 09:40:22 -0800 |
commit | 2a7a5062c9821bb986ed50e866c27ec26c4a41af (patch) | |
tree | e2ba7900e42bf9582d4a15d5fe3c4a23b46ba545 /src | |
parent | f6191e09aa8f678dd5fe3cd463d70e4a58e7b2a6 (diff) |
i965: Use the glarray _ElementSize that Mesa tracks for us.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw_upload.c | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index f3a3efed0dd..620f09fc97d 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -715,8 +715,6 @@ struct brw_vertex_element { /** The corresponding Mesa vertex attribute */ gl_vert_attrib attrib; - /** Size of a complete element */ - GLuint element_size; /** Offset of the first element within the buffer object */ unsigned int offset; }; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 8e1b9bb28e5..06a58860f21 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -380,8 +380,8 @@ copy_array_to_vbo_array(struct brw_context *brw, */ if (src_stride == 0) { intel_upload_data(&brw->intel, element->glarray->Ptr, - element->element_size, - element->element_size, + element->glarray->_ElementSize, + element->glarray->_ElementSize, &buffer->bo, &buffer->offset); buffer->stride = 0; @@ -464,8 +464,6 @@ static void brw_prepare_vertices(struct brw_context *brw) const struct gl_client_array *glarray = input->glarray; int type_size = get_size(glarray->Type); - input->element_size = type_size * glarray->Size; - if (_mesa_is_bufferobj(glarray->BufferObj)) { struct intel_buffer_object *intel_buffer = intel_buffer_object(glarray->BufferObj); @@ -579,7 +577,7 @@ static void brw_prepare_vertices(struct brw_context *brw) struct brw_vertex_buffer *buffer = &brw->vb.buffers[j]; if (upload[i]->glarray->InstanceDivisor == 0) { copy_array_to_vbo_array(brw, upload[i], min_index, max_index, - buffer, upload[i]->element_size); + buffer, upload[i]->glarray->_ElementSize); } else { /* This is an instanced attribute, since its InstanceDivisor * is not zero. Therefore, its data will be stepped after the @@ -588,7 +586,7 @@ static void brw_prepare_vertices(struct brw_context *brw) uint32_t instanced_attr_max_index = (brw->num_instances - 1) / upload[i]->glarray->InstanceDivisor; copy_array_to_vbo_array(brw, upload[i], 0, instanced_attr_max_index, - buffer, upload[i]->element_size); + buffer, upload[i]->glarray->_ElementSize); } buffer->offset -= delta * buffer->stride; buffer->step_rate = upload[i]->glarray->InstanceDivisor; |