Jump to content

Recommended Posts

Posted

Doing a performance-test with LW 4.7, I wanted to draw an element ins tanced multiple thousands of times. Using RenderDoc I found out, that Leadwerks batches these into groups of 256 elements each, so instead of having one call to glDrawElementsInstanced, instead I have quite many (which in my eyes are not needed). Also looking at the shaders, I found that they usually have a line like

#define MAX_INSTANCES 256

I believe that there is a lot of wasted potential because of this for rendering large groups of the same entity. Is there a reason for this limit? Can we increase it somehow? Will the same limitation be there in Turbo? I have attached the source code for my test.

App.h App.cpp main.cpp

Posted

The max number of instances is defined by the minimum guaranteed size of uniform buffers in OpenGL 4.0.

I believe the size is 16384, which means it can fit 256 4x4 matrices at a time.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

Vulkan has buffers of pretty much unlimited size, so in the new renderer this is already resolved.

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...