X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_lower_variable_initializers.c;h=7b90a196b2d7876f6beae87ecfaacf1f4ccf2fef;hp=3a32bbd053370d4af0b29d849ccaa17b701fee3f;hb=c256cd900e71a44490ed8a248ebc0c7f1abc38c5;hpb=4d7e064623ea4db1e5e18e18b0bb958462054ed3 diff --git a/src/compiler/nir/nir_lower_variable_initializers.c b/src/compiler/nir/nir_lower_variable_initializers.c index 3a32bbd0533..7b90a196b2d 100644 --- a/src/compiler/nir/nir_lower_variable_initializers.c +++ b/src/compiler/nir/nir_lower_variable_initializers.c @@ -88,6 +88,16 @@ nir_lower_variable_initializers(nir_shader *shader, nir_variable_mode modes) { bool progress = false; + /* Only some variables have initializers that we want to lower. Others + * such as uniforms have initializers which are useful later during linking + * so we want to skip over those. Restrict to only variable types where + * initializers make sense so that callers can use nir_var_all. + */ + modes &= nir_var_shader_out | + nir_var_shader_temp | + nir_var_function_temp | + nir_var_system_value; + nir_foreach_function(function, shader) { if (!function->impl) continue;