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 <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
This commit is contained in:
Alyssa Rosenzweig 2022-01-15 09:45:26 -05:00 committed by Marge Bot
parent 2dfebf3487
commit 3f1abda631
1 changed files with 3 additions and 5 deletions

View File

@ -2738,7 +2738,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
#endif
}
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
@ -2769,9 +2769,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);
@ -2792,7 +2790,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