nir: Add pass to split 64 bit vec3 and vec4 variable access and phis
authorGert Wollny <gert.wollny@collabora.com>
Wed, 13 Apr 2022 15:57:06 +0000 (17:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 21 Apr 2022 16:57:11 +0000 (16:57 +0000)
commit496fd59d711b9a0744878918caeeaafb961e3deb
treeb3a4fad39d8eb90db5f7ad958b8fed5cdc16206e
parentd48c10fab38217264045064b3f48ecac0c24b7bb
nir: Add pass to split 64 bit vec3 and vec4 variable access and phis

NTT can't convert local 64 variables of type vec3 or vec4, therefore,
they need to be split into vec2 + double or vec2 + vec2.

At the same time deal splitting the phi nodes.

The pass goes into the global namespace because it is also useful
for r600.

v2: only lower function_temps (Emma) and handle array of arrays (Jason)

v3: - remove bool parameter in function to merge
      vec3 and vec4
    - simplify load/store_deref_(array|var)
    - use a pointer hash table
    - simplify PHI splitting (all Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15945>
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_split_64bit_vec3_and_vec4.c [new file with mode: 0644]