summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_pipe_vertex.c
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2016-05-02 18:17:48 -0700
committerBrian Paul <[email protected]>2016-06-23 07:31:20 -0600
commit2b81e31d4488ada643560a640aa4c0f6372e9ca7 (patch)
treec2d236dbac59cbe5dc7169cb636c1fb759570996 /src/gallium/drivers/svga/svga_pipe_vertex.c
parenta1d74f5528f4bab6679fc08b1a25055336c85089 (diff)
svga: fix vertex buffer references in the hw state
This patch fixes three issues with vertex buffer references: (1) Instead of copy the vertex buffer resource handles to the hw state in the context structure, use pipe_resource_reference to properly reference the vertex buffer resources in the context. (2) Make sure to unbind those unused vertex buffer resources. (3) Force to rebind the vertex buffer resources at the first draw of each command buffer to make sure the vertex buffer resources are paged in. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_vertex.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_vertex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c
index 4692f766546..075cf5f91bf 100644
--- a/src/gallium/drivers/svga/svga_pipe_vertex.c
+++ b/src/gallium/drivers/svga/svga_pipe_vertex.c
@@ -329,6 +329,9 @@ void svga_cleanup_vertex_state( struct svga_context *svga )
pipe_resource_reference(&svga->curr.vb[i].buffer, NULL);
pipe_resource_reference(&svga->state.hw_draw.ib, NULL);
+
+ for (i = 0; i < svga->state.hw_draw.num_vbuffers; i++)
+ pipe_resource_reference(&svga->state.hw_draw.vbuffers[i], NULL);
}