Mesa (master): etnaviv: flush resource when binding as sampler view

Lucas Stach lynxeye at kemper.freedesktop.org
Thu Jun 8 16:30:14 UTC 2017


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

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Mon May 15 17:06:41 2017 +0200

etnaviv: flush resource when binding as sampler view

As TS is also allowed on sampler resources, we need to make sure to resolve
to self when binding the resource as a texture, to avoid stale content
being sampled.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>

---

 src/gallium/drivers/etnaviv/etnaviv_texture.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c
index 6f77af286f..df77829078 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c
@@ -120,6 +120,9 @@ etna_update_sampler_source(struct pipe_sampler_view *view)
       etna_copy_resource(view->context, res->texture, view->texture, 0,
                          view->texture->last_level);
       etna_resource(res->texture)->seqno = res->seqno;
+   } else if (etna_resource_needs_flush(res)) {
+      etna_copy_resource(view->context, view->texture, view->texture, 0, 0);
+      res->flush_seqno = res->seqno;
    }
 }
 




More information about the mesa-commit mailing list