diff options
author | Thomas Hellstrom <[email protected]> | 2011-03-07 10:40:26 +0100 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2011-03-09 08:49:33 +0100 |
commit | 52e598d200108ab9cfc9c9d828bbebdc576e9703 (patch) | |
tree | 124e51bcb6c6749b7ee3968ccc7bc53e49dee5d2 | |
parent | c0d3fb4b6c11fd128921c464f753480a137555a0 (diff) |
gallium/svga: Don't replace user vertex buffer with uploaded copy
Do that later on when we set up the hwtnl state instead.
This addresses a problem when we drop the uploaded copy due to a vb
size change, it will remain referenced in svga->curr.vb[], and the
new contents of the vb will never be uploaded.
Signed-off-by: Thomas Hellstrom <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_state_vdecl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index 958d00393f2..2f85f9488f9 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -78,7 +78,6 @@ upload_user_buffers( struct svga_context *svga ) buffer->b.b.width0); } - pipe_resource_reference( &svga->curr.vb[i].buffer, buffer->uploaded.buffer ); svga->curr.vb[i].buffer_offset = buffer->uploaded.offset; } } @@ -110,6 +109,7 @@ static int emit_hw_vs_vdecl( struct svga_context *svga, for (i = 0; i < svga->curr.velems->count; i++) { const struct pipe_vertex_buffer *vb = &svga->curr.vb[ve[i].vertex_buffer_index]; unsigned usage, index; + struct svga_buffer *buffer = svga_buffer(vb->buffer); svga_generate_vdecl_semantics( i, &usage, &index ); @@ -127,6 +127,7 @@ static int emit_hw_vs_vdecl( struct svga_context *svga, svga_hwtnl_vdecl( svga->hwtnl, i, &decl, + buffer->uploaded.buffer ? buffer->uploaded.buffer : vb->buffer ); } |