Mesa (main): panfrost: Specialize vertex state for Valhall

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 18:02:37 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu Apr  7 10:26:49 2022 -0400

panfrost: Specialize vertex state for Valhall

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

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 20 ++++++++++++++++++++
 src/gallium/drivers/panfrost/pan_context.h   | 14 +-------------
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index f4f9055466f..a2dd077aa1f 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -95,6 +95,26 @@ struct panfrost_sampler_view {
         struct panfrost_pool *pool;
 };
 
+struct panfrost_vertex_state {
+        unsigned num_elements;
+        struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
+
+#if PAN_ARCH >= 9
+        /* Packed attribute descriptor. All fields are set at CSO create time
+         * except for stride, which must be ORed in at draw time
+         */
+        struct mali_attribute_packed attributes[PIPE_MAX_ATTRIBS];
+#else
+        /* buffers corresponds to attribute buffer, element_buffers corresponds
+         * to an index in buffers for each vertex element */
+        struct pan_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
+        unsigned element_buffer[PIPE_MAX_ATTRIBS];
+        unsigned nr_bufs;
+
+        unsigned formats[PIPE_MAX_ATTRIBS];
+#endif
+};
+
 /* Statically assert that PIPE_* enums match the hardware enums.
  * (As long as they match, we don't need to translate them.)
  */
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index b9e3a7b1476..c234a7a3dc9 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -305,19 +305,6 @@ struct pan_vertex_buffer {
         unsigned divisor;
 };
 
-struct panfrost_vertex_state {
-        unsigned num_elements;
-
-        /* buffers corresponds to attribute buffer, element_buffers corresponds
-         * to an index in buffers for each vertex element */
-        struct pan_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
-        unsigned element_buffer[PIPE_MAX_ATTRIBS];
-        unsigned nr_bufs;
-
-        struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
-        unsigned formats[PIPE_MAX_ATTRIBS];
-};
-
 unsigned
 pan_assign_vertex_buffer(struct pan_vertex_buffer *buffers,
                          unsigned *nr_bufs,
@@ -327,6 +314,7 @@ pan_assign_vertex_buffer(struct pan_vertex_buffer *buffers,
 struct panfrost_zsa_state;
 struct panfrost_sampler_state;
 struct panfrost_sampler_view;
+struct panfrost_vertex_state;
 
 static inline struct panfrost_context *
 pan_context(struct pipe_context *pcontext)



More information about the mesa-commit mailing list