zink: fix tcs control barriers for use without vk memory model

these are translated into memory+control barriers in nir, and only
the control barrier needs to be handled

these semantics match what glslang does, so they must be right

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15959>
This commit is contained in:
Mike Blumenkrantz 2022-04-14 14:19:02 -04:00 committed by Marge Bot
parent 01ed71f945
commit 55baf0c676

View file

@ -2913,8 +2913,7 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
break;
case nir_intrinsic_memory_barrier_tcs_patch:
spirv_builder_emit_memory_barrier(&ctx->builder, SpvScopeWorkgroup,
SpvMemorySemanticsOutputMemoryMask | SpvMemorySemanticsReleaseMask);
/* handled by subsequent nir_intrinsic_control_barrier */
break;
case nir_intrinsic_memory_barrier:
@ -2942,9 +2941,12 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
break;
case nir_intrinsic_control_barrier:
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup,
SpvScopeWorkgroup,
SpvMemorySemanticsWorkgroupMemoryMask | SpvMemorySemanticsAcquireMask);
if (ctx->stage == MESA_SHADER_COMPUTE)
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup,
SpvScopeWorkgroup,
SpvMemorySemanticsWorkgroupMemoryMask | SpvMemorySemanticsAcquireMask);
else
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup, SpvScopeInvocation, 0);
break;
case nir_intrinsic_interp_deref_at_centroid: