Mesa (main): panfrost: Allow pixels using discard to be killed

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 13 14:43:32 UTC 2022


Module: Mesa
Branch: main
Commit: c43882ad544af3cddd55278212f11cbd4686da63
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c43882ad544af3cddd55278212f11cbd4686da63

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri Jun 10 12:09:13 2022 -0400

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 <alyssa at collabora.com>
Closes: #5607
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16984>

---

 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;



More information about the mesa-commit mailing list