diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 945fdf23d6f..492caa0d854 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -81,9 +81,6 @@ public: void create_function(ir_function_signature *ir); - /* True if we have any output rvalues */ - bool has_output_rvalue; - private: void add_instr(nir_instr *instr, unsigned num_components, unsigned bit_size); nir_ssa_def *evaluate_rvalue(ir_rvalue *ir); @@ -263,9 +260,7 @@ glsl_to_nir(const struct gl_constants *consts, shader->info.fs.origin_upper_left = sh->Program->info.fs.origin_upper_left; shader->info.fs.advanced_blend_modes = sh->Program->info.fs.advanced_blend_modes; - nir_foreach_variable_with_modes(var, shader, - nir_var_shader_in | - nir_var_system_value) { + nir_foreach_variable_in_shader(var, shader) { if (var->data.mode == nir_var_system_value && (var->data.location == SYSTEM_VALUE_SAMPLE_ID || var->data.location == SYSTEM_VALUE_SAMPLE_POS)) @@ -273,10 +268,10 @@ glsl_to_nir(const struct gl_constants *consts, if (var->data.mode == nir_var_shader_in && var->data.sample) shader->info.fs.uses_sample_shading = true; - } - if (v1.has_output_rvalue) - shader->info.fs.uses_sample_shading = true; + if (var->data.mode == nir_var_shader_out && var->data.fb_fetch_output) + shader->info.fs.uses_sample_shading = true; + } } return shader; @@ -287,7 +282,6 @@ nir_visitor::nir_visitor(const struct gl_constants *consts, nir_shader *shader) this->supports_std430 = consts->UseSTD430AsDefaultPacking; this->shader = shader; this->is_global = true; - this->has_output_rvalue = false; this->var_table = _mesa_pointer_hash_table_create(NULL); this->overload_table = _mesa_pointer_hash_table_create(NULL); this->sparse_variable_set = _mesa_pointer_set_create(NULL); @@ -1826,9 +1820,6 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir) enum gl_access_qualifier access = deref_get_qualifier(this->deref); this->result = nir_load_deref_with_access(&b, this->deref, access); - - if (nir_deref_mode_is(this->deref, nir_var_shader_out)) - this->has_output_rvalue = true; } return this->result;