void ir3_print_instr(struct ir3_instruction *instr);
/* depth calculation: */
+struct ir3_shader_variant;
int ir3_delayslots(struct ir3_instruction *assigner,
struct ir3_instruction *consumer, unsigned n);
void ir3_insert_by_depth(struct ir3_instruction *instr, struct list_head *list);
-void ir3_depth(struct ir3 *ir);
+void ir3_depth(struct ir3 *ir, struct ir3_shader_variant *so);
/* copy-propagate: */
-struct ir3_shader_variant;
void ir3_cp(struct ir3 *ir, struct ir3_shader_variant *so);
/* group neighbors and insert mov's to resolve conflicts: */
#include "util/u_math.h"
#include "ir3.h"
+#include "ir3_shader.h"
/*
* Instruction Depth:
}
static bool
-compute_depth_and_remove_unused(struct ir3 *ir)
+compute_depth_and_remove_unused(struct ir3 *ir, struct ir3_shader_variant *so)
{
unsigned i;
bool progress = false;
*/
list_for_each_entry (struct ir3_block, block, &ir->block_list, node) {
list_for_each_entry (struct ir3_instruction, instr, &block->instr_list, node) {
+ /* special case, if pre-fs texture fetch used, we cannot
+ * eliminate the barycentric i/j input
+ */
+ if (so->num_sampler_prefetch &&
+ (instr->opc == OPC_META_INPUT) &&
+ (instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PIXEL))
+ continue;
instr->flags |= IR3_INSTR_UNUSED;
}
}
}
void
-ir3_depth(struct ir3 *ir)
+ir3_depth(struct ir3 *ir, struct ir3_shader_variant *so)
{
bool progress;
do {
- progress = compute_depth_and_remove_unused(ir);
+ progress = compute_depth_and_remove_unused(ir, so);
} while (progress);
}