etnaviv: flush resource when binding as sampler view
authorLucas Stach <l.stach@pengutronix.de>
Mon, 15 May 2017 15:06:41 +0000 (17:06 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 8 Jun 2017 16:29:36 +0000 (18:29 +0200)
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@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_texture.c

index 6f77af286f26ce26dd1af083efead5576c51f107..df77829078c0428d4be2d7a6bdb743b463f8b62a 100644 (file)
@@ -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;
    }
 }