From 09623eb2fd4c534f625c72c315cd5c76358f9f8e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 30 Oct 2022 21:24:34 -0400 Subject: [PATCH] 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 Part-of: (cherry picked from commit c567e5528fd11db461f076fccd63ec1b01b96b36) --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_screen.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d1d19ed..53ab3c8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -481,7 +481,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 f0ecae9..a3855f9 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -210,8 +210,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: -- 2.7.4