st/mesa: handle compute atomics
authorDave Airlie <airlied@redhat.com>
Fri, 3 Nov 2017 02:23:01 +0000 (12:23 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 5 Dec 2017 10:38:35 +0000 (10:38 +0000)
Just reuse the cs atomics bit and emit the hw atomic state.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_atom_atomicbuf.c
src/mesa/state_tracker/st_context.c

index d01c227acdd40cb30949233a9d911b5df377690f..eda9e51b58140332287460f60237fb13ef158342 100644 (file)
@@ -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];
 
index da1cca471bac5597efa0bfb5d5ab95c963ecdf8b..7564a5303521fa597338d344d99b5a5eea30c403 100644 (file)
@@ -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;