panfrost: Fix padded_vertex_count generation
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 25 Feb 2020 13:16:52 +0000 (08:16 -0500)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 27 Feb 2020 15:31:42 +0000 (16:31 +0100)
commit03822a27e64e20e97b0f3c043e8bd3f584a3f93e
tree85fd8890d98b0240cab63e9a9348a3eddb594d0a
parent23c859717216253ee06482051fc08cecb63f7543
panfrost: Fix padded_vertex_count generation

These two cases were flipped from the notes, leading to underestimates
of the padded vertex count, manifesting as visual corruption (random
geometry messed up). This issue was raised when noticing the corruption
went away when dramaticlaly oversizing max_index on an instanced indexed
draw, and then checking that padded_count >= vertex_count -- which
turned out *not* to be the case on certain inputs, a clear issue. Hence
looking into this routine...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
src/panfrost/encoder/pan_attributes.c