diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2020-12-10 16:04:49 -0500 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-12-31 14:39:02 +0000 |
commit | 84f251c38a697e0cc049a920ee2d0d64df2c6562 (patch) | |
tree | cca8214c3b948a9c30543b16d0af7377f78ab52c | |
parent | 26ce13f6573819bf65ce6335533bd5707bbd88c2 (diff) |
pan/bi: Add bi_message_type_for_instr helper
Greatly simplified by the use of the table.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135>
-rw-r--r-- | src/panfrost/bifrost/bi_schedule.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index e0d539af210..45a480e0999 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -35,6 +35,26 @@ bi_is_fragz(bi_instruction *ins) ins->load_vary.var_id == BI_VARYING_NAME_FRAG_Z; } +/* Determines messsage type by checking the table and a few special cases. Only + * case missing is tilebuffer instructions that access depth/stencil, which + * require a Z_STENCIL message (to implement + * ARM_shader_framebuffer_fetch_depth_stencil) */ + +static enum bifrost_message_type +bi_message_type_for_instr(bi_instr *ins) +{ + enum bifrost_message_type msg = bi_opcode_props[ins->op].message; + bool ld_var_special = (ins->op == BI_OPCODE_LD_VAR_SPECIAL); + + if (ld_var_special && ins->varying_name == BI_VARYING_NAME_FRAG_Z) + return BIFROST_MESSAGE_Z_STENCIL; + + if (msg == BIFROST_MESSAGE_LOAD && ins->seg == BI_SEG_UBO) + return BIFROST_MESSAGE_ATTRIBUTE; + + return msg; +} + static enum bifrost_message_type bi_message_type_for_ins(bi_instruction *ins) { |