nir/glsl: Emit memory barriers as part of barrier()
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 7 Jan 2020 20:40:53 +0000 (14:40 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jan 2020 17:23:47 +0000 (17:23 +0000)
commitba43b66dc996988ec326d35395e9699ea4f66fdf
treeff8ffbdd00b4b08f3507a3762db2d9d6e7e8f654
parenta4125b4d261df39189f67dffaa5c90c0f6f66fe6
nir/glsl: Emit memory barriers as part of barrier()

The GLSL barrier() intrinsic does an implicit shared memory barrier in
compute shaders and an implicit TCS patch output barrier in tessellation
control shaders.  We'd like NIR's barrier intrinsic to just be a control
flow barrier and not have memory implications.  To satisfy this, we need
to add an extra memory barrier in front of each nir_intrinsic_barrier.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
src/compiler/glsl/glsl_to_nir.cpp