agx: Avoid scratch mem with tri strip w/ adjacency

with restart unroll kernel where nir fails to optimize this away without a
little help from us.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
This commit is contained in:
Alyssa Rosenzweig 2023-11-26 21:13:53 -04:00
parent 7f9ef5b176
commit 4a4c6d1bc6

View file

@ -93,8 +93,15 @@ libagx_vertex_id_for_topology(enum mesa_prim mode, bool flatshade_first,
even_or_first ? 3 : -2,
};
/* Ensure NIR can see thru the local array */
uint offset = 0;
for (uint i = 1; i < 6; ++i) {
if (i == vert)
offset = offsets[i];
}
/* Finally add to the base of the primitive */
return (prim * 2) + offsets[vert];
return (prim * 2) + offset;
}
default: