From c43882ad544af3cddd55278212f11cbd4686da63 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 10 Jun 2022 12:09:13 -0400 Subject: [PATCH] panfrost: Allow pixels using discard to be killed info.fs.sidefx considers discard() to be a side effect. That definition is... dubious at best. It certainly isn't the definition needed for forward pixel kill. The only reason pixels couldn't be killed by FPK is if the shader has side effects in the sense of writing to memory. Use that more precise condition so FPK works more often. Signed-off-by: Alyssa Rosenzweig Closes: #5607 Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +- src/panfrost/lib/pan_shader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index e8f6b21aa51..97cf2097b9b 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -3325,7 +3325,7 @@ panfrost_emit_draw(void *out, cfg.zs_update_operation = kill.zs_update; cfg.allow_forward_pixel_to_kill = pan_allow_forward_pixel_to_kill(ctx, fs); - cfg.allow_forward_pixel_to_be_killed = !fs->info.fs.sidefx; + cfg.allow_forward_pixel_to_be_killed = !fs->info.writes_global; /* Mask of render targets that may be written. A render * target may be written if the fragment shader writes diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index 17d920819d1..11770e74cad 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -238,7 +238,7 @@ pan_shader_prepare_bifrost_rsd(const struct pan_shader_info *info, info->fs.writes_coverage || info->fs.can_discard; rsd->properties.allow_forward_pixel_to_be_killed = - !info->fs.sidefx; + !info->writes_global; #if PAN_ARCH >= 7 rsd->properties.shader_wait_dependency_6 = info->bifrost.wait_6;