asahi: simplify IA mode handling

we'll solve the IA variants problem a different way, for now make more
straightforward.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-01-29 16:18:46 -04:00 committed by Marge Bot
parent e1783fc083
commit cdd1b012e9
2 changed files with 3 additions and 16 deletions

View file

@ -33,6 +33,8 @@ agx_vertex_id_for_topology(nir_builder *b, nir_def *vert,
switch (key->mode) {
case MESA_PRIM_POINTS:
return prim;
case MESA_PRIM_LINES:
case MESA_PRIM_TRIANGLES:
case MESA_PRIM_LINES_ADJACENCY:

View file

@ -2452,21 +2452,6 @@ agx_update_vs(struct agx_context *ctx)
(union asahi_shader_key *)&key);
}
static enum mesa_prim
translate_ia_mode(enum mesa_prim prim)
{
switch (prim) {
case MESA_PRIM_POINTS:
case MESA_PRIM_LINE_STRIP:
case MESA_PRIM_LINE_STRIP_ADJACENCY:
/* Every vertex defines a primitive */
return MESA_PRIM_POINTS;
default:
return prim;
}
}
static bool
agx_update_tcs(struct agx_context *ctx, const struct pipe_draw_info *info)
{
@ -2530,7 +2515,7 @@ agx_update_gs(struct agx_context *ctx, const struct pipe_draw_info *info,
/* XXX: Deduplicate this code from regular vertex */
struct asahi_gs_shader_key key = {
.ia.index_size = info->index_size,
.ia.mode = translate_ia_mode(info->mode),
.ia.mode = info->mode,
.ia.flatshade_first =
ia_needs_provoking(info->mode) && ctx->rast->base.flatshade_first,