[Mesa-dev] [RFC 3/4] gallium: Add global buffer memory barrier bit
Marek Olšák
maraeo at gmail.com
Sun Mar 27 17:39:47 UTC 2016
Looks good.
Marek
On Fri, Mar 25, 2016 at 2:43 AM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> 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 at basnieuwenhuizen.nl>
> ---
> src/gallium/include/pipe/p_defines.h | 1 +
> src/gallium/state_trackers/clover/core/kernel.cpp | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 8257b4a..6f30f9e 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -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
> diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
> index bce3b52..266d50e 100644
> --- a/src/gallium/state_trackers/clover/core/kernel.cpp
> +++ b/src/gallium/state_trackers/clover/core/kernel.cpp
> @@ -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();
> }
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list