spirv: Add support for lowering workgroup access to offsets

Graphics / Mesa 3D Graphics Library / Mesa - Jason Ekstrand [intel.com] - 6 December 2017 06:01 EST

Before, we always left workgroup variables as shared nir_variables and let the driver call nir_lower_io. This adds an option to do the lowering directly in spirv_to_nir. To do this, we implicitly assign the
variables a std430 layout and then treat them like a UBO or SSBO and immediately lower all the way to an offset.

As a side-effect, the spirv_to_nir pass now handles variable pointers for workgroup variables.

ae54a4f84f spirv: Add support for lowering workgroup access to offsets
src/compiler/spirv/nir_spirv.h | 8 +++
src/compiler/spirv/spirv_to_nir.c | 130 +++++++++++++++++++++++++++++++++----
src/compiler/spirv/vtn_private.h | 17 ++++-
src/compiler/spirv/vtn_variables.c | 54 +++++++++++++--
4 files changed, 190 insertions(+), 19 deletions(-)

Upstream: cgit.freedesktop.org


  • Share