From 0b3270b9b72c2ca4fad172752045d8fa93c1ad6e Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 25 Sep 2011 18:13:50 +0200 Subject: u_vbuf_mgr: cleanup original vs real vertex buffer arrays It can now override both buffer offsets and strides in additions to resources. Overriding buffer offsets was kinda hackish and could cause issues with non-native vertex formats. --- src/gallium/drivers/r600/r600_state_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r600') diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index a331b0a4a56..559e75a8f11 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -506,13 +506,13 @@ static void r600_vertex_buffer_update(struct r600_pipe_context *rctx) /* one resource per vertex elements */ unsigned vbuffer_index; vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index; - vertex_buffer = &rctx->vbuf_mgr->vertex_buffer[vbuffer_index]; - rbuffer = (struct r600_resource*)rctx->vbuf_mgr->real_vertex_buffer[vbuffer_index]; + vertex_buffer = &rctx->vbuf_mgr->real_vertex_buffer[vbuffer_index]; + rbuffer = (struct r600_resource*)vertex_buffer->buffer; offset = rctx->vertex_elements->vbuffer_offset[i]; } else { /* bind vertex buffer once */ - vertex_buffer = &rctx->vbuf_mgr->vertex_buffer[i]; - rbuffer = (struct r600_resource*)rctx->vbuf_mgr->real_vertex_buffer[i]; + vertex_buffer = &rctx->vbuf_mgr->real_vertex_buffer[i]; + rbuffer = (struct r600_resource*)vertex_buffer->buffer; offset = 0; } if (vertex_buffer == NULL || rbuffer == NULL) -- cgit v1.2.3