Taken mostly directly from the anv pass. A few anv-specific things that I could leave in anv aren't included. Specifically on turnip we don't need to set gl_Layer to 0, and we can handle the case where the FS reads gl_ViewIndex, so that check is moved into anv.
ffe946d7e82 nir: Add nir_lower_multiview pass
src/compiler/Makefile.sources | 1 +
src/compiler/nir/meson.build | 1 +
src/compiler/nir/nir.h | 4 +
src/compiler/nir/nir_lower_multiview.c | 348 +++++++++++++++++++++++++++++++++
4 files changed, 354 insertions(+)