panfrost: Only call nir_lower_io on shader_in/out
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 10 Jun 2020 22:54:25 +0000 (17:54 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Jul 2020 19:54:30 +0000 (19:54 +0000)
Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

src/panfrost/bifrost/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c

index 319584263315f5c02505f263d7153328f3fafd89..adaf6fa3ea8e90e95b66434eefd60bb05122a8f1 100644 (file)
@@ -1292,7 +1292,8 @@ bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, unsigned
         NIR_PASS_V(nir, nir_lower_global_vars_to_local);
         NIR_PASS_V(nir, nir_lower_var_copies);
         NIR_PASS_V(nir, nir_lower_vars_to_ssa);
-        NIR_PASS_V(nir, nir_lower_io, nir_var_all, glsl_type_size, 0);
+        NIR_PASS_V(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
+                        glsl_type_size, 0);
         NIR_PASS_V(nir, nir_lower_ssbo);
         NIR_PASS_V(nir, nir_lower_mediump_outputs);
 
index 1460f6c23b2ddcf6948db735bd2a353ff1351e23..fe8b5c47a3f8b7c98ad15feed85dfd743e2e4530 100644 (file)
@@ -2747,7 +2747,8 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
         NIR_PASS_V(nir, nir_lower_var_copies);
         NIR_PASS_V(nir, nir_lower_vars_to_ssa);
 
-        NIR_PASS_V(nir, nir_lower_io, nir_var_all, glsl_type_size, 0);
+        NIR_PASS_V(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
+                        glsl_type_size, 0);
         NIR_PASS_V(nir, nir_lower_ssbo);
         NIR_PASS_V(nir, midgard_nir_lower_zs_store);