st/mesa: add shader buffer barrier bit
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 11 Jan 2016 03:39:16 +0000 (22:39 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 30 Jan 2016 02:05:47 +0000 (21:05 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_cb_texturebarrier.c

index b46187bc8a12137422622a7bfec90f8bd4edddbe..335f4e6a2621a2c17158a7730674b90b21edfe3d 100644 (file)
@@ -352,6 +352,7 @@ enum pipe_flush_flags
  * Flags for pipe_context::memory_barrier.
  */
 #define PIPE_BARRIER_MAPPED_BUFFER     (1 << 0)
+#define PIPE_BARRIER_SHADER_BUFFER     (1 << 1)
 
 /**
  * Resource binding flags -- state tracker must specify in advance all
index dd4dde74c864cd910e4c12547359aeeb79359e5c..6f6176b9fe51a5bd535c3ab1671fca1e99a840a3 100644 (file)
@@ -65,6 +65,10 @@ st_MemoryBarrier(struct gl_context *ctx, GLbitfield barriers)
 
    if (barriers & GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT)
       flags |= PIPE_BARRIER_MAPPED_BUFFER;
+   if (barriers & GL_ATOMIC_COUNTER_BARRIER_BIT)
+      flags |= PIPE_BARRIER_SHADER_BUFFER;
+   if (barriers & GL_SHADER_STORAGE_BARRIER_BIT)
+      flags |= PIPE_BARRIER_SHADER_BUFFER;
 
    if (flags && pipe->memory_barrier)
       pipe->memory_barrier(pipe, flags);