summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2015-06-21 15:00:16 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2015-06-25 15:17:02 +0100
commit9ffa1f7a1b938d6103f97d064a7443ae03d9a9d9 (patch)
tree7c7835846c71206fa46149bd9af0a2e56e5f490f
parentc4dc2a5e2c0ccbd0cc30c9cdf205775b2cb690a8 (diff)
nvc0: always put all tfb bufs into bufctx
Since we clear the TFB bufctx binding point above, we need to put all of the active tfb's back in, even if they haven't changed since last time. Otherwise the tfb may get moved into sysmem and the underlying mapping will generate write errors. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9fcbf515b431a92e0289f234ab77a796cf2a5612)
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
index 516b33b76d5..7fe050cbe3d 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
@@ -262,11 +262,13 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
if (tfb)
targ->stride = tfb->stride[b];
+ buf = nv04_resource(targ->pipe.buffer);
+
+ BCTX_REFN(nvc0->bufctx_3d, TFB, buf, WR);
+
if (!(nvc0->tfbbuf_dirty & (1 << b)))
continue;
- buf = nv04_resource(targ->pipe.buffer);
-
if (!targ->clean)
nvc0_query_fifo_wait(push, targ->pq);
BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
@@ -280,7 +282,6 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
PUSH_DATA(push, 0); /* TFB_BUFFER_OFFSET */
targ->clean = FALSE;
}
- BCTX_REFN(nvc0->bufctx_3d, TFB, buf, WR);
}
for (; b < 4; ++b)
IMMED_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 0);