* reads from other subgroup lanes)? This only applies to fragment shaders.
* Other shader stages do not have a notion of helper threads. */
-static bool
+bool
bi_instr_uses_helpers(bi_instr *I)
{
switch (I->op) {
return false;
}
-static bool
+bool
bi_block_terminates_helpers(bi_block *block)
{
/* Can't terminate if a successor needs helpers */
if (block->pass_flags == 0 && bi_block_uses_helpers(block))
bi_propagate_pass_flag(block);
}
+}
+
+void
+bi_mark_clauses_td(bi_context *ctx)
+{
+ if (ctx->stage != MESA_SHADER_FRAGMENT || ctx->inputs->is_blend)
+ return;
/* Finally, mark clauses requiring helpers */
bi_foreach_block(ctx, block) {
bi_assign_scoreboard(ctx);
/* Analyze after scheduling since we depend on instruction
- * order. This routine assumes the IR is using clauses, so it is
- * Bifrost only.
+ * order. Valhall calls as part of va_insert_flow_control_nops,
+ * as the handling for clauses differs from instructions.
*/
bi_analyze_helper_terminate(ctx);
+ bi_mark_clauses_td(ctx);
}
if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal)
/* BIR passes */
+bool bi_instr_uses_helpers(bi_instr *I);
+bool bi_block_terminates_helpers(bi_block *block);
void bi_analyze_helper_terminate(bi_context *ctx);
+void bi_mark_clauses_td(bi_context *ctx);
+
void bi_analyze_helper_requirements(bi_context *ctx);
void bi_opt_copy_prop(bi_context *ctx);
void bi_opt_cse(bi_context *ctx);