Module: Mesa
Branch: staging/21.3
Commit: ad8313ce13e5edef4f17115f4c95bc0b42ff64c7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad8313ce13e5edef4f17115f4c95bc0b42ff64c7

Author: Alyssa Rosenzweig <[email protected]>
Date:   Sat Jan 15 09:45:26 2022 -0500

panfrost: Use u_reduced_prim for primitive checks

Use a Gallium helper that papers over the differences between primitive
types, as required by hardware operation.

[Cc'd to mesa-stable for use in the next commit.]

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
(cherry picked from commit 3f1abda631f6f98cd48858728db22c874124a858)

---

 .pick_status.json                            | 2 +-
 src/gallium/drivers/panfrost/pan_cmdstream.c | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 391a6a675ac..3af48c8e564 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -40,7 +40,7 @@
         "description": "panfrost: Use u_reduced_prim for primitive checks",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c 
b/src/gallium/drivers/panfrost/pan_cmdstream.c
index ae5e116b7a8..f3fe0b209ee 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -2715,7 +2715,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
                 }
         }
 
-        bool points = info->mode == PIPE_PRIM_POINTS;
+        enum pipe_prim_type prim = u_reduced_prim(info->mode);
         void *prim_size = pan_section_ptr(job, TILER_JOB, PRIMITIVE_SIZE);
 
 #if PAN_ARCH >= 6
@@ -2746,9 +2746,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
                  * be set to 0 and the provoking vertex is selected with the
                  * PRIMITIVE.first_provoking_vertex field.
                  */
-                if (info->mode == PIPE_PRIM_LINES ||
-                    info->mode == PIPE_PRIM_LINE_LOOP ||
-                    info->mode == PIPE_PRIM_LINE_STRIP) {
+                if (prim == PIPE_PRIM_LINES) {
                         /* The logic is inverted across arches. */
                         cfg.flat_shading_vertex = rast->flatshade_first
                                                 ^ (PAN_ARCH <= 5);
@@ -2769,7 +2767,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
                 }
         }
 
-        panfrost_emit_primitive_size(ctx, points, psiz, prim_size);
+        panfrost_emit_primitive_size(ctx, prim == PIPE_PRIM_POINTS, psiz, 
prim_size);
 }
 
 static void

Reply via email to