summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@collabora.com>2022-10-30 21:24:34 -0400
committerDylan Baker <dylan.c.baker@intel.com>2022-11-18 09:47:10 -0800
commit4f55467cce48cb79c55635a5b837b5447bd772ef (patch)
tree82895c464c6e07f53de4cd31b29c9d26139db04c
parent083f3382b0eac43bef183820bda6a220509714b7 (diff)
downloadmesa-4f55467cce48cb79c55635a5b837b5447bd772ef.tar.gz
panfrost: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
..instead of 4BYTE_ALIGNED_ONLY. This is more correct and avoids needless repacking. Noticed in Firefox, which was hitting the vbuf translate path. Fixes: e03622e50fc ("panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19761> (cherry picked from commit c567e5528fd11db461f076fccd63ec1b01b96b36)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 61e4b000f8e..6ec49adb942 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1048,7 +1048,7 @@
"description": "panfrost: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "e03622e50fcebbcc32b2fd403b1a729c73cb49d5"
},
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index b17e2809e19..50037663279 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -213,8 +213,16 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_QUERY_TIMESTAMP:
return is_gl3;
- /* TODO: Where does this req come from in practice? */
- case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
+ /* The hardware requires element alignment for data conversion to work
+ * as expected. If data conversion is not required, this restriction is
+ * lifted on Midgard at a performance penalty. We conservatively
+ * require element alignment for vertex buffers, using u_vbuf to
+ * translate to match the hardware requirement.
+ *
+ * This is less heavy-handed than the 4BYTE_ALIGNED_ONLY caps, which
+ * would needlessly require alignment even for 8-bit formats.
+ */
+ case PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY:
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_SIZE: