diff options
author | Thomas Hellstrom <[email protected]> | 2011-03-10 23:29:03 +0100 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2011-03-10 23:31:42 +0100 |
commit | ded1e315a432ca8b813f7d6fadc97b0d311ba398 (patch) | |
tree | 780d6396e332f931a72533e96bc56f7f8cb5d215 /src/gallium/drivers/svga | |
parent | fb3b712b84528b192834d3ba3df557b25bbe6e6e (diff) |
Revert "gallium/svga: Only upload parts of vertexarrays that are actually used"
This reverts commit 6d4e337f3890105c7d8a2f132412c137d2570d25.
The commit is incorrect. I'll rework it. Revert for now.
Signed-off-by: Thomas Hellstrom <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_draw_arrays.c | 19 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_draw_elements.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_buffer.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_buffer_upload.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_state_vdecl.c | 9 |
5 files changed, 3 insertions, 48 deletions
diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index 1bb29cc2335..a6518042eb9 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -32,7 +32,6 @@ #include "svga_draw.h" #include "svga_draw_private.h" #include "svga_context.h" -#include "svga_resource_buffer.h" #define DBG 0 @@ -192,8 +191,6 @@ simple_draw_arrays( struct svga_hwtnl *hwtnl, SVGA3dPrimitiveRange range; unsigned hw_prim; unsigned hw_count; - unsigned i; - unsigned src_offs; hw_prim = svga_translate_prim(prim, count, &hw_count); if (hw_count == 0) @@ -212,22 +209,6 @@ simple_draw_arrays( struct svga_hwtnl *hwtnl, * looking at those numbers knows to adjust them by * range.indexBias. */ - - for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { - struct pipe_resource *vb = hwtnl->cmd.vdecl_vb[i]; - struct svga_buffer *sbuf = svga_buffer(vb); - unsigned stride = hwtnl->cmd.vdecl[i].array.stride; - unsigned tmp_src_offs = sbuf->source_offset; - - if (stride) - tmp_src_offs /= stride; - assert(i == 0 || tmp_src_offs == src_offs); - src_offs = tmp_src_offs; - } - - range.indexBias = start - src_offs; - assert(range.indexBias >= 0); - return svga_hwtnl_prim( hwtnl, &range, 0, count - 1, NULL ); } diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index cf61144c9ae..7d420c6b295 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -113,7 +113,6 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, unsigned hw_count; unsigned index_offset = start * index_size; int ret = PIPE_OK; - unsigned i, src_offs; hw_prim = svga_translate_prim(prim, count, &hw_count); if (hw_count == 0) @@ -143,21 +142,6 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, index_buffer = upload_buffer; } - for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { - struct pipe_resource *vb = hwtnl->cmd.vdecl_vb[i]; - struct svga_buffer *sbuf = svga_buffer(vb); - unsigned stride = hwtnl->cmd.vdecl[i].array.stride; - unsigned tmp_src_offs = sbuf->source_offset; - - if (stride) - tmp_src_offs /= stride; - assert(i == 0 || tmp_src_offs == src_offs); - src_offs = tmp_src_offs; - } - - index_bias -= src_offs; - assert(index_bias >= 0); - range.primType = hw_prim; range.primitiveCount = hw_count; range.indexArray.offset = index_offset; diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h index 31a6fc6fef1..c559f70ec12 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.h +++ b/src/gallium/drivers/svga/svga_resource_buffer.h @@ -144,12 +144,6 @@ struct svga_buffer } uploaded; /** - * The offset in the source user buffer that matches the - * uploaded offset - */ - unsigned source_offset; - - /** * DMA'ble memory. * * A piece of GMR memory, with the same size of the buffer. It is created diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c index 601643236a9..b7d54605e66 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c +++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c @@ -695,7 +695,6 @@ svga_redefine_user_buffer(struct pipe_context *pipe, sbuf->key.size.width = sbuf->b.b.width0 = offset + size; } - sbuf->source_offset = offset; pipe_mutex_unlock(ss->swc_mutex); svga->curr.any_user_vertex_buffers = TRUE; diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index 5bd51ca677d..2f85f9488f9 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -59,8 +59,8 @@ upload_user_buffers( struct svga_context *svga ) if (!buffer->uploaded.buffer) { boolean flushed; ret = u_upload_buffer( svga->upload_vb, - 0, buffer->source_offset, - buffer->b.b.width0 - buffer->source_offset, + 0, 0, + buffer->b.b.width0, &buffer->b.b, &buffer->uploaded.offset, &buffer->uploaded.buffer, @@ -69,19 +69,16 @@ upload_user_buffers( struct svga_context *svga ) return ret; if (0) - debug_printf("%s: %d: orig buf %p upl buf %p ofs %d sofs %d" - " sz %d\n", + debug_printf("%s: %d: orig buf %p upl buf %p ofs %d sz %d\n", __FUNCTION__, i, buffer, buffer->uploaded.buffer, buffer->uploaded.offset, - buffer->source_offset, buffer->b.b.width0); } svga->curr.vb[i].buffer_offset = buffer->uploaded.offset; - svga_buffer(buffer->uploaded.buffer)->source_offset = buffer->source_offset; } } |