diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-22 16:31:03 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-23 15:51:25 -0700 |
commit | 20ac0b8e4e3a1d27c298a18d5a10681cb483c798 (patch) | |
tree | 5ed7b817b6813273c12c57d31231be8e2772901b /src/panfrost/midgard/disassemble.c | |
parent | 9d3fc737afcb98e3882b4d54c9d093980cfb4874 (diff) |
pan/midgard: Analyze helper invocations
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 <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/disassemble.c')
-rw-r--r-- | src/panfrost/midgard/disassemble.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index b26dfb84e8d..a7f407bdef8 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -1221,6 +1221,22 @@ print_texture_format(int format) } } +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) { @@ -1281,6 +1297,9 @@ print_texture_word(uint32_t *word, unsigned tabs) { 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); |