bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
bool lower_const_arrays_to_uniforms(exec_list *instructions);
bool lower_clip_distance(gl_shader *shader);
-void lower_output_reads(exec_list *instructions);
+void lower_output_reads(unsigned stage, exec_list *instructions);
bool lower_packing_builtins(exec_list *instructions, int op_mask);
void lower_ubo_reference(struct gl_shader *shader, exec_list *instructions);
void lower_packed_varyings(void *mem_ctx,
hash_table *replacements;
void *mem_ctx;
+
+ unsigned stage;
public:
- output_read_remover();
+ output_read_remover(unsigned stage);
~output_read_remover();
virtual ir_visitor_status visit(class ir_dereference_variable *);
virtual ir_visitor_status visit_leave(class ir_emit_vertex *);
return hash_table_string_hash(var->name);
}
-output_read_remover::output_read_remover()
+output_read_remover::output_read_remover(unsigned stage)
{
+ this->stage = stage;
mem_ctx = ralloc_context(NULL);
replacements =
hash_table_ctor(0, hash_table_var_hash, hash_table_pointer_compare);
{
if (ir->var->data.mode != ir_var_shader_out)
return visit_continue;
+ if (stage == MESA_SHADER_TESS_CTRL)
+ return visit_continue;
ir_variable *temp = (ir_variable *) hash_table_find(replacements, ir->var);
}
void
-lower_output_reads(exec_list *instructions)
+lower_output_reads(unsigned stage, exec_list *instructions)
{
- output_read_remover v;
+ output_read_remover v(stage);
visit_list_elements(&v, instructions);
}
} while (progress);
if (options->NirOptions != NULL)
- lower_output_reads(shader->ir);
+ lower_output_reads(stage, shader->ir);
validate_ir_tree(shader->ir);
prog->Parameters);
/* Remove reads from output registers. */
- lower_output_reads(shader->ir);
+ lower_output_reads(shader->Stage, shader->ir);
/* Emit intermediate IR for main(). */
visit_exec_list(shader->ir, v);