ac/nir/ngg: fix gs culling vertex liveness check for odd vertices
authorQiang Yu <yuq825@gmail.com>
Wed, 5 Apr 2023 01:27:50 +0000 (09:27 +0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 03:42:25 +0000 (03:42 +0000)
commitc082cdacae8fc977f0c39ea12874e183ceac3286
treeeec56b662cc311b4f8f5b20f2603d42dfa993f2f
parentfc3d8e1125524eb8f7dfdefd6ca2a716c68c0e7d
ac/nir/ngg: fix gs culling vertex liveness check for odd vertices

If vertex does not complete a primitive, it should not set the odd
flag which miss lead liveness check when culling is enabled.

For example, if odd flag is set regardless of complete flag, when
culling is enabled, 3 vertices of a triangle's init prim flag:
  [0x00 0x04 0x01]

then after culling, this triangle has been culled, their prim flag:
  [0x00 0x04 0x00]

the second vertex is miss treat as live because its odd flag (code
check prim_flag!=0 for liveness).

Fixes: 1bdeb961bd8 ("ac/nir/ngg: add gs culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8725
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
src/amd/common/ac_nir_lower_ngg.c