summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_tex.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-02-24 17:04:49 +0100
committerChristoph Bumiller <[email protected]>2011-02-24 17:35:35 +0100
commit67c7aefea33a7935e42ede30463eb7ca5009b068 (patch)
treea1f83b80dcdf33a0b6c3cc04dce01110856c4b34 /src/gallium/drivers/nvc0/nvc0_tex.c
parenta6ea37da4bd02241ce3bf522b93dd7ff0757f959 (diff)
nvc0: sync textures with render targets ourselves
Fixes for example piglit/fbo-flushing and nexuiz' bloom effect.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_tex.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_tex.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_tex.c b/src/gallium/drivers/nvc0/nvc0_tex.c
index b219f82c903..968558a5869 100644
--- a/src/gallium/drivers/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nvc0/nvc0_tex.c
@@ -196,9 +196,16 @@ nvc0_validate_tic(struct nvc0_context *nvc0, int s)
OUT_RINGp (chan, &tic->tic[3], 5);
need_flush = TRUE;
+ } else
+ if (res->status & NVC0_BUFFER_STATUS_GPU_WRITING) {
+ BEGIN_RING(chan, RING_3D(TEX_CACHE_CTL), 1);
+ OUT_RING (chan, (tic->id << 4) | 1);
}
nvc0->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32);
+ res->status &= ~NVC0_BUFFER_STATUS_GPU_WRITING;
+ res->status |= NVC0_BUFFER_STATUS_GPU_READING;
+
nvc0_bufctx_add_resident(nvc0, NVC0_BUFCTX_TEXTURES, res,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);