[Mesa-dev] [Bug 107295] Access violation on glDrawArrays with count >= 2048

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 20 16:02:39 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107295

--- Comment #5 from Roland Scheidegger <sroland at vmware.com> ---
Ah actually I found the issue.
We cannot handle having more than a ushort number of vertices in
alloc_vertices() (possibly elsewhere too).
There's logic to split things into smaller chunks (the vsplit stuff in the
backtrace) based on various things, but among others there's an absolute limit
of 4096 vertices at once, so that the chunks don't get too big (bad for caches
etc.)
But that's coming from a time without GS, which can amplify the amount of
vertices (by quite a lot), which is exactly what's happening here. The 101088
vertices don't fit into a ushort and hence the allocated buffer is too small as
a result.
(With the pipeline path, things will be split into individual prims and only a
couple at once emitted.)
I suspect the easiest fix is to just use uints instead of ushorts there. While
we didn't really want such large numbers, we cannot split things in the
front-end reasonably so we don't exceed that later after the gs (the
amplification limit is 1024 after all). I suppose another possibility would be
to split things after gs again but not sure it warrants the complexity...

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180720/f6392e95/attachment-0001.html>


More information about the mesa-dev mailing list