summaryrefslogtreecommitdiff
path: root/src/sna/gen5_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-21 18:41:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-11-21 18:42:24 +0000
commitd3a49f36395d737698616fe8ba9da7b74cd2d89a (patch)
tree2a2beaf0273e0c3ff9942035711450b5844e3f03 /src/sna/gen5_render.c
parent1c57a52a1f46e8401429955d8c96fd5095c9012a (diff)
sna/gen3+: Clear the render.vbo when replacing it for vertex upload
As we may trigger a flush and a retire when searching for a vertex buffer for the new vertices, we need to be careful to decouple the destroyed vbo in order to avoid a use-after-free when inspecting the state. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r--src/sna/gen5_render.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 54d7c86b..0e3aec67 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -274,6 +274,7 @@ static int gen5_vertex_finish(struct sna *sna)
sna->render.nvertex_reloc = 0;
sna->render.vertex_used = 0;
sna->render.vertex_index = 0;
+ sna->render.vbo = NULL;
sna->render_state.gen5.vb_id = 0;
kgem_bo_destroy(&sna->kgem, bo);