spirv: Expand workaround for OpControlBarrier on old GLSLang
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Tue, 21 Apr 2020 15:20:39 +0000 (18:20 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Apr 2020 08:46:12 +0000 (08:46 +0000)
commit66229aa16968eb60dd631a8f48f593a4fa8478d5
treefcc4c39e2f0ed8b065ca3637a9786e1310b987ce
parentf402b7c57641dd2ab4d39032574294c03d75b595
spirv: Expand workaround for OpControlBarrier on old GLSLang

In SPIRV of compute shader in Aztec Ruins benchmark there is:

OpControlBarrier %uint_1 %uint_1 %uint_0
// ControlBarrier(Device, Device, rdcspv::MemorySemantics(0));

which is an incorrect translation of glsl barrier().

GLSLang, prior to c3f1cdfa, emitted the OpControlBarrier with
Device instead of Workgroup for execution scope.

2365520c covers similar case but isn't applied when execution_scope
is SpvScopeDevice.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2742
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4660>
src/compiler/spirv/spirv_to_nir.c