Mesa (master): nv50,nvc0: implement texture barrier

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Sat Mar 19 13:46:50 UTC 2011


Module: Mesa
Branch: master
Commit: 83ff3809f1bf081964dc63ae48dc91f031e0a859
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=83ff3809f1bf081964dc63ae48dc91f031e0a859

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Thu Mar 17 17:07:30 2011 +0100

nv50,nvc0: implement texture barrier

---

 src/gallium/drivers/nv50/nv50_context.c |   12 ++++++++++++
 src/gallium/drivers/nvc0/nvc0_context.c |   10 ++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index 930cee7..632ca4d 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -46,6 +46,17 @@ nv50_flush(struct pipe_context *pipe,
    FIRE_RING(screen->channel);
 }
 
+static void
+nv50_texture_barrier(struct pipe_context *pipe)
+{
+   struct nouveau_channel *chan = nv50_context(pipe)->screen->base.channel;
+
+   BEGIN_RING(chan, RING_3D(SERIALIZE), 1);
+   OUT_RING  (chan, 0);
+   BEGIN_RING(chan, RING_3D(TEX_CACHE_CTL), 1);
+   OUT_RING  (chan, 0x20);
+}
+
 void
 nv50_default_flush_notify(struct nouveau_channel *chan)
 {
@@ -125,6 +136,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
    pipe->clear = nv50_clear;
 
    pipe->flush = nv50_flush;
+   pipe->texture_barrier = nv50_texture_barrier;
 
    if (!screen->cur_ctx)
       screen->cur_ctx = nv50;
diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index 5d2168e..2f2a3da 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -47,6 +47,15 @@ nvc0_flush(struct pipe_context *pipe,
 }
 
 static void
+nvc0_texture_barrier(struct pipe_context *pipe)
+{
+   struct nouveau_channel *chan = nvc0_context(pipe)->screen->base.channel;
+
+   IMMED_RING(chan, RING_3D(SERIALIZE), 0);
+   IMMED_RING(chan, RING_3D(TEX_CACHE_CTL), 0);
+}
+
+static void
 nvc0_context_unreference_resources(struct nvc0_context *nvc0)
 {
    unsigned s, i;
@@ -128,6 +137,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
    pipe->clear = nvc0_clear;
 
    pipe->flush = nvc0_flush;
+   pipe->texture_barrier = nvc0_texture_barrier;
 
    if (!screen->cur_ctx)
       screen->cur_ctx = nvc0;




More information about the mesa-commit mailing list