[Mesa-dev] SPIR-V: Use NIR deref instructions for UBO/SSBO access

Jason Ekstrand jason at jlekstrand.net
Sat Dec 15 00:51:36 UTC 2018


New MR: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/17

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.

Happy reviewing!

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181214/49bb5506/attachment.html>


More information about the mesa-dev mailing list