We check for texture ops which calculate derivatives (either explicitly
via dFd* or implicitly) and mark the shader as requiring helper
invocations.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
}
}
+static bool
+midgard_op_has_helpers(unsigned op, bool gather)
+{
+ if (gather)
+ return true;
+
+ switch (op) {
+ case TEXTURE_OP_NORMAL:
+ case TEXTURE_OP_DFDX:
+ case TEXTURE_OP_DFDY:
+ return true;
+ default:
+ return false;
+ }
+}
+
static void
print_texture_op(unsigned op, bool gather)
{
{
midgard_texture_word *texture = (midgard_texture_word *) word;
+ midg_stats.helper_invocations |=
+ midgard_op_has_helpers(texture->op, texture->is_gather);
+
/* Broad category of texture operation in question */
print_texture_op(texture->op, texture->is_gather);
unsigned instruction_count;
unsigned bundle_count;
unsigned quadword_count;
+
+ /* Should we enable helper invocations? */
+ bool helper_invocations;
};
struct midgard_disasm_stats