aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/pandecode
diff options
context:
space:
mode:
authorTomeu Vizoso <[email protected]>2019-11-05 15:31:42 +0100
committerTomeu Vizoso <[email protected]>2019-11-06 16:18:46 +0100
commit8e1ae5fa14c87f0c3eb0ae2b2f850a97feabf2f7 (patch)
tree7ecf59408ed4d40863bb483fee4f5e5314e0b689 /src/panfrost/pandecode
parentafeda06062fef3542ca792ace6a15dc78371658b (diff)
panfrost: Decode blend shaders for SFBD
Also set MALI_HAS_BLEND_SHADER as needed. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/pandecode')
-rw-r--r--src/panfrost/pandecode/decode.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 7c1d681d018..94b640c54d6 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -2069,6 +2069,30 @@ pandecode_shader_prop(const char *name, unsigned claim, signed truth, bool fuzzy
}
static void
+pandecode_blend_shader_disassemble(mali_ptr shader, int job_no, int job_type,
+ bool is_bifrost)
+{
+ struct midgard_disasm_stats stats =
+ pandecode_shader_disassemble(shader, job_no, job_type, is_bifrost);
+
+ bool has_texture = (stats.texture_count > 0);
+ bool has_sampler = (stats.sampler_count > 0);
+ bool has_attribute = (stats.attribute_count > 0);
+ bool has_varying = (stats.varying_count > 0);
+ bool has_uniform = (stats.uniform_count > 0);
+ bool has_ubo = (stats.uniform_buffer_count > 0);
+
+ if (has_texture || has_sampler)
+ pandecode_msg("XXX: blend shader accessing textures\n");
+
+ if (has_attribute || has_varying)
+ pandecode_msg("XXX: blend shader accessing interstage\n");
+
+ if (has_uniform || has_ubo)
+ pandecode_msg("XXX: blend shader accessing uniforms\n");
+}
+
+static void
pandecode_vertex_tiler_postfix_pre(
const struct mali_vertex_tiler_postfix *p,
int job_no, enum mali_job_type job_type,
@@ -2245,9 +2269,10 @@ pandecode_vertex_tiler_postfix_pre(
if (!is_bifrost) {
/* TODO: Blend shaders routing/disasm */
-
union midgard_blend blend = s->blend;
- pandecode_midgard_blend(&blend, false);
+ mali_ptr shader = pandecode_midgard_blend(&blend, s->unknown2_3 & MALI_HAS_BLEND_SHADER);
+ if (shader & ~0xF)
+ pandecode_blend_shader_disassemble(shader, job_no, job_type, false);
}
pandecode_indent--;
@@ -2267,26 +2292,8 @@ pandecode_vertex_tiler_postfix_pre(
else
shader = pandecode_midgard_blend_mrt(blend_base, job_no, i);
- if (shader & ~0xF) {
- struct midgard_disasm_stats stats =
- pandecode_shader_disassemble(shader, job_no, job_type, false);
-
- bool has_texture = (stats.texture_count > 0);
- bool has_sampler = (stats.sampler_count > 0);
- bool has_attribute = (stats.attribute_count > 0);
- bool has_varying = (stats.varying_count > 0);
- bool has_uniform = (stats.uniform_count > 0);
- bool has_ubo = (stats.uniform_buffer_count > 0);
-
- if (has_texture || has_sampler)
- pandecode_msg("XXX: blend shader accessing textures\n");
-
- if (has_attribute || has_varying)
- pandecode_msg("XXX: blend shader accessing interstage\n");
-
- if (has_uniform || has_ubo)
- pandecode_msg("XXX: blend shader accessing uniforms\n");
- }
+ if (shader & ~0xF)
+ pandecode_blend_shader_disassemble(shader, job_no, job_type, false);
}
}