Mesa (master): panfrost: Add helper to determine if we are capturing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 12 14:59:54 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Jun 10 15:13:12 2020 -0400

panfrost: Add helper to determine if we are capturing

That is, is the varying setup for xfb *and* is there a buffer for it?

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 6480733a2b5..1b2e632cf1b 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -1929,6 +1929,21 @@ pan_emit_vary_xfb(unsigned present,
         return meta;
 }
 
+/* Determine if we should capture a varying for XFB. This requires actually
+ * having a buffer for it. If we don't capture it, we'll fallback to a general
+ * varying path (linked or unlinked, possibly discarding the write) */
+
+static bool
+panfrost_xfb_captured(struct panfrost_shader_state *xfb,
+                unsigned loc, unsigned max_xfb)
+{
+        if (!(xfb->so_mask & (1ll << loc)))
+                return false;
+
+        struct pipe_stream_output *o = pan_get_so(&xfb->stream_output, loc);
+        return o->output_buffer < max_xfb;
+}
+
 void
 panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
                                  unsigned vertex_count,



More information about the mesa-commit mailing list