zink: force line strip out when emulating stipple
authorantonino <antonino.maniscalco@collabora.com>
Fri, 3 Feb 2023 14:43:09 +0000 (15:43 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 29 Mar 2023 19:18:40 +0000 (19:18 +0000)
commit0cb81ac38c20edf40c4aa0edcff4633d0bb6b767
tree49cd6e50609a5503c541b0fdd48276ffd1125719
parent3b5fb8b0607e1e8e0916ab8f6acaf01f061e94f8
zink: force line strip out when emulating stipple

Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered
with line stipple, the edge between the first and last vertex will have
stretched out stipple.

This happens because interpolation will occur between two non consecutive
stipple counters for the last edge
(which is between the last and first vertices).

Forcing `nir_create_passthrough_gs` to generate a line strip avoids
this because the last vertex will be duplicated and will have
the correct stipple counter for each edge.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
src/gallium/drivers/zink/zink_program.c