gallium: add global buffer memory barrier bit
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 24 Mar 2016 22:11:03 +0000 (23:11 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 1 Apr 2016 23:51:06 +0000 (01:51 +0200)
Currently radeonsi synchronizes after every dispatch and Clover
does nothing to synchronize. This is overzealous, especially with
GL compute, so add a barrier for global buffers.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/include/pipe/p_defines.h
src/gallium/state_trackers/clover/core/kernel.cpp

index 8257b4a7142221051054190ce3f573c1e1f1680f..6f30f9ed7d3320ff13f9b1f4362736f6d8e5c398 100644 (file)
@@ -368,6 +368,7 @@ enum pipe_flush_flags
 #define PIPE_BARRIER_IMAGE             (1 << 8)
 #define PIPE_BARRIER_FRAMEBUFFER       (1 << 9)
 #define PIPE_BARRIER_STREAMOUT_BUFFER  (1 << 10)
+#define PIPE_BARRIER_GLOBAL_BUFFER     (1 << 11)
 
 /**
  * Resource binding flags -- state tracker must specify in advance all
index bce3b525b139efdb8723ad805d2bb28bad710cce..266d50e61453bdbaad83f2f4009d56538fb40cd2 100644 (file)
@@ -89,6 +89,8 @@ kernel::launch(command_queue &q,
                              exec.sviews.size(), NULL);
    q.pipe->bind_sampler_states(q.pipe, PIPE_SHADER_COMPUTE, 0,
                                exec.samplers.size(), NULL);
+
+   q.pipe->memory_barrier(q.pipe, PIPE_BARRIER_GLOBAL_BUFFER);
    exec.unbind();
 }