From: Jason Ekstrand Date: Wed, 10 Jun 2020 23:02:39 +0000 (-0500) Subject: v3d: Only call nir_lower_io on shader_in/out X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23b7094829d185ba2b40cdb75b730849b21e8b2b;p=mesa.git v3d: Only call nir_lower_io on shader_in/out 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 Reviewed-by: Connor Abbott Part-of: --- diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index dbe3c7b4454..2415b279754 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -306,14 +306,12 @@ v3d_uncompiled_shader_create(struct pipe_context *pctx, s = tgsi_to_nir(ir, pctx->screen, false); } - nir_variable_mode lower_mode = nir_var_all & ~nir_var_uniform; - if (s->info.stage == MESA_SHADER_VERTEX || - s->info.stage == MESA_SHADER_GEOMETRY) { - lower_mode &= ~(nir_var_shader_in | nir_var_shader_out); - } - NIR_PASS_V(s, nir_lower_io, lower_mode, - type_size, - (nir_lower_io_options)0); + if (s->info.stage != MESA_SHADER_VERTEX && + s->info.stage != MESA_SHADER_GEOMETRY) { + NIR_PASS_V(s, nir_lower_io, + nir_var_shader_in | nir_var_shader_out, + type_size, (nir_lower_io_options)0); + } NIR_PASS_V(s, nir_lower_regs_to_ssa); NIR_PASS_V(s, nir_normalize_cubemap_coords);