Skip to content

SPIR-V: Use NIR deref instructions for UBO/SSBO access

Faith Ekstrand requested to merge gfxstrand/mesa:review/spirv-ubo-deref into master

This MR begins the process of being able to optimize external memory access by first moving us over to using deref instructions for UBO/SSBO access.

Many of the patches are cleanups or fairly small refactors of NIR or SPIR-V. More notable changes include:

  • Reworking some NIR variable modes to properly distinguish between UBOs and other uniforms
  • Adding support to glsl_type for explicit strides/offsets on types.
  • Adding a new ptr-as-array deref type to NIR
  • Adding a new nir_opt_deref pass to optimize ptr-as-array derefs
  • Relaxing several NIR validation rules
  • Adding support for cast derefs to a couple of passes
  • Adding UBO/SSBO deref support to spirv_to_nir but hidden behind a flag
  • Enabling the new path in ANV.

All in all, I think I finally have a version of this that I'm actually happy with. It took several iterations to figure out how I wanted to best describe the type information coming out of SPIR-V. The glsl_type modifications ended up being not nearly as bad as I expected so I went that route.

Merge request reports