[Mesa-dev] [PATCH 01/21] st/mesa: handle compute atomics

Nicolai Hähnle nhaehnle at gmail.com
Thu Nov 30 15:22:03 UTC 2017


On 29.11.2017 05:36, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> Just reuse the cs atomics bit and emit the hw atomic state.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


> ---
>   src/mesa/state_tracker/st_atom_atomicbuf.c | 4 ++++
>   src/mesa/state_tracker/st_context.c        | 2 +-
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c b/src/mesa/state_tracker/st_atom_atomicbuf.c
> index d01c227..eda9e51 100644
> --- a/src/mesa/state_tracker/st_atom_atomicbuf.c
> +++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
> @@ -123,6 +123,10 @@ st_bind_tes_atomics(struct st_context *st)
>   void
>   st_bind_cs_atomics(struct st_context *st)
>   {
> +   if (st->has_hw_atomics) {
> +      st_bind_hw_atomic_buffers(st);
> +      return;
> +   }
>      struct gl_program *prog =
>         st->ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE];
>   
> diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
> index da1cca4..7564a53 100644
> --- a/src/mesa/state_tracker/st_context.c
> +++ b/src/mesa/state_tracker/st_context.c
> @@ -302,7 +302,7 @@ st_init_driver_flags(struct st_context *st)
>      /* Shader resources */
>      f->NewTextureBuffer = ST_NEW_SAMPLER_VIEWS;
>      if (st->has_hw_atomics)
> -      f->NewAtomicBuffer = ST_NEW_HW_ATOMICS;
> +      f->NewAtomicBuffer = ST_NEW_HW_ATOMICS | ST_NEW_CS_ATOMICS;
>      else
>         f->NewAtomicBuffer = ST_NEW_ATOMIC_BUFFER;
>      f->NewShaderStorageBuffer = ST_NEW_STORAGE_BUFFER;
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list