panfrost: Partially determine FPK state

This might be disabled at draw-time, but we can merge part of the state
check to compile-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
This commit is contained in:
Alyssa Rosenzweig
2021-05-14 19:17:23 -04:00
committed by Marge Bot
parent 0dd3d32141
commit 974709c51c
3 changed files with 10 additions and 6 deletions

View File

@@ -506,11 +506,7 @@ panfrost_prepare_bifrost_fs_state(struct panfrost_context *ctx,
}
state->properties.bifrost.allow_forward_pixel_to_kill =
!fs->info.fs.writes_depth &&
!fs->info.fs.writes_stencil &&
!fs->info.fs.writes_coverage &&
!fs->info.fs.can_discard &&
!fs->info.fs.outputs_read &&
fs->info.fs.can_fpk &&
!(rt_mask & ~fs->info.outputs_written) &&
!alpha_to_coverage &&
!blend_reads_dest;

View File

@@ -226,6 +226,14 @@ pan_shader_compile(const struct panfrost_device *dev,
!info->fs.writes_stencil &&
!info->fs.writes_coverage;
/* Similiarly with suitable state, is FPK possible? */
info->fs.can_fpk =
!info->fs.writes_depth &&
!info->fs.writes_stencil &&
!info->fs.writes_coverage &&
!info->fs.can_discard &&
!info->fs.outputs_read;
info->fs.reads_frag_coord =
(s->info.inputs_read & (1 << VARYING_SLOT_POS)) ||
BITSET_TEST(s->info.system_values_read, SYSTEM_VALUE_FRAG_COORD);

View File

@@ -180,7 +180,7 @@ struct pan_shader_info {
bool reads_helper_invocation;
bool sample_shading;
bool early_fragment_tests;
bool can_early_z;
bool can_early_z, can_fpk;
BITSET_WORD outputs_read;
BITSET_WORD outputs_written;
} fs;