lima: Only call nir_lower_io on shader_in/out
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 10 Jun 2020 22:49:13 +0000 (17:49 -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: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

src/gallium/drivers/lima/lima_program.c

index 0d942d4712698bac9dac084df26619a21abd3e19..1bb1bd88622eb280f9a9fec0114dd1060a0c1aa9 100644 (file)
@@ -101,7 +101,8 @@ lima_program_optimize_vs_nir(struct nir_shader *s)
 
    NIR_PASS_V(s, nir_lower_viewport_transform);
    NIR_PASS_V(s, nir_lower_point_size, 1.0f, 100.0f);
-   NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0);
+   NIR_PASS_V(s, nir_lower_io,
+             nir_var_shader_in | nir_var_shader_out, type_size, 0);
    NIR_PASS_V(s, nir_lower_load_const_to_scalar);
    NIR_PASS_V(s, lima_nir_lower_uniform_to_scalar);
    NIR_PASS_V(s, nir_lower_io_to_scalar,
@@ -193,7 +194,8 @@ lima_program_optimize_fs_nir(struct nir_shader *s,
    bool progress;
 
    NIR_PASS_V(s, nir_lower_fragcoord_wtrans);
-   NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0);
+   NIR_PASS_V(s, nir_lower_io,
+             nir_var_shader_in | nir_var_shader_out, type_size, 0);
    NIR_PASS_V(s, nir_lower_regs_to_ssa);
    NIR_PASS_V(s, nir_lower_tex, tex_options);