summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2019-08-08 12:46:43 +0200
committerIago Toral Quiroga <[email protected]>2019-08-13 08:25:15 +0200
commitf1cf1153e800f3854279d2459f3191441634beff (patch)
treec17def1be4efbbfff9bb944dcfbe20835c900b3e /src/gallium/drivers/v3d
parentf1559ca922de9e31f70b72a1f8fb3b1fbfe7d5ca (diff)
v3d: only process glMemoryBarrier() for SSBOs and images
PIPE_BARRIER_UPDATE is defined as: PIPE_BARRIER_UPDATE_BUFFER | PIPE_BARRIER_UPDATE_TEXTURE Which means we were flushing for any flags other than these two, but this was intended to only flush for ssbos and images. Actually, the driver automatically flushes jobs as we need, including writes/reads involving SSBOs and images, so we don't really need to flush anything when the program emits a barrier. However, this may lead to excessive flushing in some cases, so we will soon change this to avoid atutomatic flushing of the current job for SSBOs and images, meaning that we will rely on the application to emit correct memory barriers for these that we should make sure to process here. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r--src/gallium/drivers/v3d/v3d_context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/v3d/v3d_context.c b/src/gallium/drivers/v3d/v3d_context.c
index 8dc8dd63581..93f0caabc35 100644
--- a/src/gallium/drivers/v3d/v3d_context.c
+++ b/src/gallium/drivers/v3d/v3d_context.c
@@ -72,7 +72,13 @@ v3d_memory_barrier(struct pipe_context *pctx, unsigned int flags)
{
struct v3d_context *v3d = v3d_context(pctx);
- if (!(flags & ~PIPE_BARRIER_UPDATE))
+ /* We only need to flush for SSBOs and images, because for everything
+ * else we flush the job automatically when we needed.
+ */
+ const unsigned int flush_flags = PIPE_BARRIER_SHADER_BUFFER |
+ PIPE_BARRIER_IMAGE;
+
+ if (!(flags & flush_flags))
return;
/* We only need to flush jobs writing to SSBOs/images. */