Mesa (master): panfrost: Fix padded_vertex_count generation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 27 15:48:14 UTC 2020


Module: Mesa
Branch: master
Commit: 03822a27e64e20e97b0f3c043e8bd3f584a3f93e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03822a27e64e20e97b0f3c043e8bd3f584a3f93e

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Feb 25 08:16:52 2020 -0500

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 at collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>

---

 src/panfrost/encoder/pan_attributes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/panfrost/encoder/pan_attributes.c b/src/panfrost/encoder/pan_attributes.c
index d4c8ab6e8ad..d0d79486185 100644
--- a/src/panfrost/encoder/pan_attributes.c
+++ b/src/panfrost/encoder/pan_attributes.c
@@ -64,7 +64,7 @@ panfrost_large_padded_vertex_count(uint32_t vertex_count)
 
         switch (middle_two) {
         case 0b00:
-                if (nibble & 1)
+                if (!(nibble & 1))
                         return (1 << n) * 9;
                 else
                         return (1 << (n + 1)) * 5;



More information about the mesa-commit mailing list