spirv: Add a workaround for OpControlBarrier on old GLSLang
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 7 Jan 2020 17:35:54 +0000 (11:35 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jan 2020 17:23:47 +0000 (17:23 +0000)
commit2365520c9d321c015a8e6751351d75cffea5008f
treeb635fab8467e990f4832c15748942966af397491
parent60097cc840e33af8506d7d4d621fefdca1a77695
spirv: Add a workaround for OpControlBarrier on old GLSLang

As per the Vulkan memory model, the proper translation of GLSL barrier()
is an OpControlBarrier with a scope of Workgroup and semantics of
Acquire, Release, and WorkgroupMemory.  Older versions of GLSLang gave
an OpControlBarrier with semantics of None so we need to patch it up on
those versions.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_private.h