From 7cccc89f80c594e3f59977fb4c7c6569e52569c7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 5 Apr 2019 01:17:21 +0000 Subject: [PATCH] panfrost/decode: Add flags for tilebuffer readback These flags are set when reading back the tilebuffer from a fragment shader via various mechanisms (including ARM_shader_framebuffer_fetch and EXT_pixel_local_storage). Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/include/panfrost-job.h | 7 +++++++ src/gallium/drivers/panfrost/pandecode/decode.c | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h index f0a4de7..2f739bf 100644 --- a/src/gallium/drivers/panfrost/include/panfrost-job.h +++ b/src/gallium/drivers/panfrost/include/panfrost-job.h @@ -408,6 +408,13 @@ enum mali_format { /* 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. diff --git a/src/gallium/drivers/panfrost/pandecode/decode.c b/src/gallium/drivers/panfrost/pandecode/decode.c index 20f789d..bb6f4b1 100644 --- a/src/gallium/drivers/panfrost/pandecode/decode.c +++ b/src/gallium/drivers/panfrost/pandecode/decode.c @@ -218,6 +218,15 @@ static const struct pandecode_flag_info mfbd_extra_flag_info[] = { }; #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; @@ -1163,9 +1172,11 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix 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--; -- 2.7.4