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

Nuno Santos nuno.santos at imaginando.pt
Mon Oct 25 10:35:46 CEST 2021


Laszlo,

Thanks for your reply.

I’ve tried to set indexType as UnsignedIntType but it made no difference what so ever.

I’m wondering why does it make no difference. Is this explainable in any way?

I guess we will need to proceed with the splitting…

Thanks!

Nuno

> On 21 Oct 2021, at 09:44, Laszlo Agocs <laszlo.agocs at qt.io> wrote:
> 
> Hi Nuno,
> 
> Try setting the index type to UnsignedInt in https://doc.qt.io/qt-5/qsggeometry.html#QSGGeometry and providing the index values as uint32s instead of uint16. (unless you are targeting something that does not support uint indices, although that's probably unlikely today)
> 
> Alternatively, splitting it up is the traditional solution.
> 
> Best regards,
> Laszlo
> 
> -----Original Message-----
> From: Interest <interest-bounces at qt-project.org> On Behalf Of Shawn Rutledge
> Sent: Wednesday, October 20, 2021 6:50 PM
> To: Nuno Santos <nuno.santos at imaginando.pt>
> Cc: Qt Interest <interest at qt-project.org>
> Subject: Re: [Interest] Are there limits to the number of vertices that can be allocated on a QSGGeometry?
> 
> 
> 
>> On 2021 Oct 20, at 18:11, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>> 
>> 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?
> 
> Probably the ideal thing to do is break up the vertices into chunks somewhere around the 64k limit, but maybe the graphics guys will have something else to suggest.  I was just working on Text recently: each character is a quad (so the limit is 16k characters per node); and if you render too much text in one Text item, the first node creates more, as children of itself.  That was already working since early Qt 5 releases; I just did some optimizations recently to save memory and time while generating those; and now in 6.2 all the children are direct children rather than being recursively nested.  So that’s one way to break it up when you have too many vertices.
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest



More information about the Interest mailing list