/* Applies to unknown1 */
#define MALI_NO_ALPHA_TO_COVERAGE (1 << 10)
+/* Flags denoting the fragment shader's use of tilebuffer readback. If the
+ * shader might read any part of the tilebuffer, set MALI_READS_TILEBUFFER. If
+ * it might read depth/stencil in particular, also set MALI_READS_ZS */
+
+#define MALI_READS_ZS (1 << 12)
+#define MALI_READS_TILEBUFFER (1 << 16)
+
struct mali_blend_meta {
#ifndef BIFROST
/* Base value of 0x200.
};
#undef FLAG_INFO
+#define FLAG_INFO(flag) { MALI_##flag, "MALI_" #flag }
+static const struct pandecode_flag_info shader_unknown1_flag_info [] = {
+ FLAG_INFO(NO_ALPHA_TO_COVERAGE),
+ FLAG_INFO(READS_TILEBUFFER),
+ FLAG_INFO(READS_ZS),
+ {}
+};
+#undef FLAG_INFO
+
extern char *replace_fragment;
extern char *replace_vertex;
pandecode_prop("uniform_count = %" PRId16, s->midgard1.uniform_count);
pandecode_prop("work_count = %" PRId16, s->midgard1.work_count);
- pandecode_prop("unknown1 = %s0x%" PRIx32,
- s->midgard1.unknown1 & MALI_NO_ALPHA_TO_COVERAGE ? "MALI_NO_ALPHA_TO_COVERAGE | " : "",
- s->midgard1.unknown1 & ~MALI_NO_ALPHA_TO_COVERAGE);
+
+ pandecode_log(".unknown1 = ");
+ pandecode_log_decoded_flags(shader_unknown1_flag_info, s->midgard1.unknown1);
+ pandecode_log_cont(",\n");
+
pandecode_prop("unknown2 = 0x%" PRIx32, s->midgard1.unknown2);
pandecode_indent--;