From b45420094765a4e1d61d94aa02a317f75644ac7b Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 28 Nov 2013 16:23:15 -0500 Subject: [PATCH] nv50: wait on the buf's fence before sticking it into pushbuf This resolves some rendering issues in source games. See https://bugs.freedesktop.org/show_bug.cgi?id=64323 Signed-off-by: Ilia Mirkin Cc: "9.2 10.0" --- src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index c6162b5..dc61a2e 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -597,6 +597,15 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten, assert(nouveau_resource_mapped_by_gpu(nv50->idxbuf.buffer)); + /* This shouldn't have to be here. The going theory is that the buffer + * is being filled in by PGRAPH, and it's not done yet by the time it + * gets submitted to PFIFO, which in turn starts immediately prefetching + * the not-yet-written data. Ideally this wait would only happen on + * pushbuf submit, but it's probably not a big performance difference. + */ + if (buf->fence && !nouveau_fence_signalled(buf->fence)) + nouveau_fence_wait(buf->fence); + while (instance_count--) { BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1); PUSH_DATA (push, prim); -- 1.8.3.2