summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-10-05 17:16:35 -0400
committerRob Clark <[email protected]>2017-10-26 08:39:32 -0400
commit9fc7de827e8a3026623645ba661b58257ddb85cf (patch)
tree92ae26feaf6fce44d0ad9d79b0baa350249504d1 /src
parenta6bd23e43bd18845c5364156346ad457915b2189 (diff)
freedreno: GL_ARB_texture_barrier
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.c12
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 20480f4f8c1..60b50b26acf 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -67,6 +67,17 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
}
}
+static void
+fd_texture_barrier(struct pipe_context *pctx, unsigned flags)
+{
+ /* On devices that could sample from GMEM we could possibly do better.
+ * Or if we knew that we were doing GMEM bypass we could just emit a
+ * cache flush, perhaps? But we don't know if future draws would cause
+ * us to use GMEM, and a flush in bypass isn't the end of the world.
+ */
+ fd_context_flush(pctx, NULL, 0);
+}
+
/**
* emit marker string as payload of a no-op packet, which can be
* decoded by cffdump.
@@ -273,6 +284,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
pctx->set_debug_callback = fd_set_debug_callback;
pctx->create_fence_fd = fd_create_fence_fd;
pctx->fence_server_sync = fd_fence_server_sync;
+ pctx->texture_barrier = fd_texture_barrier;
pctx->stream_uploader = u_upload_create_default(pctx);
if (!pctx->stream_uploader)
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index e061f186922..37875019226 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -181,6 +181,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
case PIPE_CAP_STRING_MARKER:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
+ case PIPE_CAP_TEXTURE_BARRIER:
return 1;
case PIPE_CAP_VERTEXID_NOBASE:
@@ -196,7 +197,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_TEXCOORD:
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
case PIPE_CAP_TEXTURE_MULTISAMPLE:
- case PIPE_CAP_TEXTURE_BARRIER:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_QUERY_MEMORY_INFO:
case PIPE_CAP_PCI_GROUP: