diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 726da8f14d9..219b4b75a3b 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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; diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c index f84c345e5fd..a027ed80669 100644 --- a/src/panfrost/lib/pan_shader.c +++ b/src/panfrost/lib/pan_shader.c @@ -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); diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 1f4c6503e04..f317df75927 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -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;