From 4d8f82946b22396c90ca102a44de7bdebd8838d6 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 19 Jun 2019 10:28:12 +0200 Subject: [PATCH] v3d: flush jobs writing to vertex buffers used in the current draw call This can happen when any of our vertex buffers was written by a previous transform feedback draw. Fixes the following piglit tests: spec/ext_transform_feedback/position-render-bufferbase spec/ext_transform_feedback/position-render-bufferbase-discard spec/ext_transform_feedback/position-render-bufferoffset spec/ext_transform_feedback/position-render-bufferoffset-discard spec/ext_transform_feedback/position-render-bufferrange spec/ext_transform_feedback/position-render-bufferrange-discard Reviewed-by: Eric Anholt --- src/gallium/drivers/v3d/v3dx_draw.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 98f630766ca..fe07231d474 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -177,6 +177,15 @@ v3d_predraw_check_stage_inputs(struct pipe_context *pctx, v3d_flush_jobs_writing_resource(v3d, view->base.resource); } + + /* Flush writes to our vertex buffers (i.e. from transform feedback) */ + if (s == PIPE_SHADER_VERTEX) { + foreach_bit(i, v3d->vertexbuf.enabled_mask) { + struct pipe_vertex_buffer *vb = &v3d->vertexbuf.vb[i]; + + v3d_flush_jobs_writing_resource(v3d, vb->buffer.resource); + } + } } static void -- 2.30.2