aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_texturebarrier.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-27 21:45:54 +0100
committerMarek Olšák <[email protected]>2014-02-25 16:05:41 +0100
commitdfa0b8d9b87ba1094ba12e6feb554a1b09da2de5 (patch)
tree53d15ac7fd1bf30543c7df8898b637d389faffeb /src/mesa/state_tracker/st_cb_texturebarrier.c
parent5f61f052b5fd8e590eca652fdac381452eb9853d (diff)
st/mesa: implement ARB_buffer_storage
Reviewed-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texturebarrier.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texturebarrier.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_texturebarrier.c b/src/mesa/state_tracker/st_cb_texturebarrier.c
index 2f1a22b5888..dd4dde74c86 100644
--- a/src/mesa/state_tracker/st_cb_texturebarrier.c
+++ b/src/mesa/state_tracker/st_cb_texturebarrier.c
@@ -54,7 +54,24 @@ st_TextureBarrier(struct gl_context *ctx)
}
+/**
+ * Called via ctx->Driver.MemoryBarrier()
+ */
+static void
+st_MemoryBarrier(struct gl_context *ctx, GLbitfield barriers)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ unsigned flags = 0;
+
+ if (barriers & GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT)
+ flags |= PIPE_BARRIER_MAPPED_BUFFER;
+
+ if (flags && pipe->memory_barrier)
+ pipe->memory_barrier(pipe, flags);
+}
+
void st_init_texture_barrier_functions(struct dd_function_table *functions)
{
functions->TextureBarrier = st_TextureBarrier;
+ functions->MemoryBarrier = st_MemoryBarrier;
}