[Interest] Are there limits to the number of vertices that can be allocated on a QSGGeometry?

Nuno Santos nuno.santos at imaginando.pt
Wed Oct 20 18:11:24 CEST 2021


Hi Shawn,

Thank you very much for your reply and clarification.

My next question is, what is the best way to work around this?

Should I create a QSGGeometryNode that draws an element and then create a node for each element?

Do you think this will degrade the performance?

Is there any other way of making it more performant?

Thanks!

Regards,

Nuno

> On 20 Oct 2021, at 16:59, Shawn Rutledge <Shawn.Rutledge at qt.io> wrote:
> 
> 
> 
>> On 2021 Oct 20, at 17:36, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>> 
>> Hi,
>> 
>> I have a custom QSGGeometryNode that renders several elements using triangles.
>> 
>> Each element is composed by 4 rectangles, this means that each element needs 6x4=24 vertices.
>> 
>> If there are more than a certain number of elements to be drawn, artefacts pop up. This artefacts are characterised by lines that connect to the origin, or with vertices on other elements.
>> 
>> I have stumbled on this issue when rendering a scene with roughly 3800 elements, which require 91200 vertices. I’m using colored point 2d vertices. 
>> 
>> 
>> Are there limits to the number of vertices that can be allocated on a QSGGeometry?
> 
> Yes: it uses 16-bit indices, and the last index is reserved to indicate primitive restart.  So you can have up to 65534 vertices per node. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20211020/837a77c2/attachment.html>


More information about the Interest mailing list