mesa/formats: add more MESA_FORMAT_LAYOUTs
[mesa.git] / src / mesa / state_tracker / st_cb_texturebarrier.c
index 2f1a22b588866e0e2a889d54d34c82fd01d5b84c..dd4dde74c864cd910e4c12547359aeeb79359e5c 100644 (file)
@@ -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;
 }