shader: Emit the right GLSL function when dealing with TGSI_MEMBAR_ATOMIC_BUFFER

The GLSL spec does not mention a memoryBarrierAtomic function, and the
GLSL to TGSI compiler indicates that a TGSI_MEMBAR_ATOMIC_BUFFER is
created from GLSL's memoryBarrierAtomicCounter.

Ref: 526f7d7790/src/mesa/state_tracker/st_glsl_to_tgsi.cpp (L3737)

This fixes:
  KHR-GL43.compute_shader.shared-struct

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Rohan Garg 3 years ago
parent 60648d4a63
commit 161de6096d
  1. 2
      src/vrend_shader.c

@ -5464,7 +5464,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
emit_buf(&ctx->glsl_strbufs, "memoryBarrierBuffer();\n"); emit_buf(&ctx->glsl_strbufs, "memoryBarrierBuffer();\n");
} }
if (val & TGSI_MEMBAR_ATOMIC_BUFFER) { if (val & TGSI_MEMBAR_ATOMIC_BUFFER) {
emit_buf(&ctx->glsl_strbufs, "memoryBarrierAtomic();\n"); emit_buf(&ctx->glsl_strbufs, "memoryBarrierAtomicCounter();\n");
} }
if (val & TGSI_MEMBAR_SHADER_IMAGE) { if (val & TGSI_MEMBAR_SHADER_IMAGE) {
emit_buf(&ctx->glsl_strbufs, "memoryBarrierImage();\n"); emit_buf(&ctx->glsl_strbufs, "memoryBarrierImage();\n");

Loading…
Cancel
Save