nir: Add ability to overwrite incomplete GS primitives.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 15 Jul 2020 11:44:39 +0000 (13:44 +0200)
committerTimur Kristóf <timur.kristof@gmail.com>
Fri, 9 Oct 2020 13:26:14 +0000 (15:26 +0200)
commit70b94adddb71d9d12a793b188d0336566504afec
tree04cf73c17309e1684c7799804c91e0cbc01de3dd
parentc977c369d35eed4de429f76ec6daf7ce95e7d94a
nir: Add ability to overwrite incomplete GS primitives.

After each end_primitive and at the end of the shader before emitting
set_vertex_and_primitive_count, we check if the primitive that is being
emitted has enough vertices or not, and we adjust the vertex and
primitive counters accordingly.

As a result, if the backend uses this option, the backend compiler
will not have to worry about discarding the unneeded vertices
and primitives.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_gs_intrinsics.c