Mesa (staging/20.0): v3d: Primitive Counts Feedback needs an extra 32-bit padding.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 10 17:11:09 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 9a0e6d649039af614805d187078cfdd0096198b3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a0e6d649039af614805d187078cfdd0096198b3

Author: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
Date:   Wed Apr  8 20:51:52 2020 +0200

v3d: Primitive Counts Feedback needs an extra 32-bit padding.

Store Primitive Counts operations write 7 counters in 32-bit words
but also a padding 32-bit with 0. So we need 8 32-bit words instead
of the current 7 allocated.

This was causing an corruption in the next buffer when Transform
Feedback was enabled that were exposed on tests like:
dEQP-GLES3.functional.transform_feedback.*.points.*

This patch fixes 196 tests that were failing when they were run isolated
but they were passing when run using cts-runner.

Fixes: 0f2d1dfe65bf ("v3d: use the GPU to record primitives written to transform feedback")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2674
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4501>
(cherry picked from commit b06fdb8edd9ef999ee8707335888f7609c144102)

---

 .pick_status.json                    | 2 +-
 src/gallium/drivers/v3d/v3dx_state.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 97d536eebe9..23c1e49c32a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -202,7 +202,7 @@
         "description": "v3d: Primitive Counts Feedback needs an extra 32-bit padding.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "0f2d1dfe65bfe1ee8f02ce45f100a5508debdfd4"
     },
diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c
index a0bb71ca540..8e58468006c 100644
--- a/src/gallium/drivers/v3d/v3dx_state.c
+++ b/src/gallium/drivers/v3d/v3dx_state.c
@@ -1250,7 +1250,8 @@ v3d_set_stream_output_targets(struct pipe_context *pctx,
 
         /* Create primitive counters BO if needed */
         if (num_targets > 0 && !ctx->prim_counts) {
-                uint32_t zeroes[7] = { 0 }; /* Init all 7 counters to 0 */
+                /* Init all 7 counters and 1 padding to 0 */
+                uint32_t zeroes[8] = { 0 };
                 u_upload_data(ctx->uploader,
                               0, sizeof(zeroes), 32, zeroes,
                               &ctx->prim_counts_offset,



More information about the mesa-commit mailing list