radeonsi: fix applying the NGG minimum vertex count requirement
authorMarek Olšák <marek.olsak@amd.com>
Thu, 30 Jul 2020 12:19:48 +0000 (08:19 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 7 Aug 2020 15:22:21 +0000 (11:22 -0400)
commit64c741ffb7aa0ae40c4302bc065fef0192123c6a
treeec36d59ce2167ad02e8216d8d15952675b2ab914
parent7a468fc0f6a02d2ee71b50225459de335ed689b4
radeonsi: fix applying the NGG minimum vertex count requirement

The code applied the restriction too late, which could overflow LDS size,
which started happening more often after the minimum vertex count was
increased for Sienna.

Incorporate the clamping into the previous code for rounding up the counts.
Now the LDS size can never overflow, but it may use vector lanes less
efficiently (max_gsprims can be decreased more), which will be addressed
in the next commit.

Fixes: 4ecc39e1aa1 ("radeonsi/gfx10: NGG geometry shader PM4 and upload")
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6137>
src/gallium/drivers/radeonsi/gfx10_shader_ngg.c