On 10/01/2019 15:08, Shawn Rutledge wrote:
The next problem is how to use custom shaders and adjustable uniforms without breaking batching in the scene graph; today, the number of draw calls goes up if you do that. This is the reason we don’t have GPU-calculated AA line charts, and it’s also the reason we don’t have the nice Ellipse that I wrote for Qt Quick. Every custom shader runs in a separate batch (that’s unavoidable). Shaders can’t have dynamically adjusted uniforms (for animation, or for limiting the scope of rendering of a vertex array), or even uniforms that vary between instances, without breaking batching, and that’s a terrible limitation that I would like to see solved somehow in a future scene graph implementation, if there’s any way.
glDrawElementsInstanced() in ES 3 and OpenGL 3 can be used or if you want to go further you can index into uniform buffer objects or SSBOs and use things like glMultiDrawIndirect. There are equivalents in Vulkan/Metal/DX12 of course.
However, limiting everything to the feature set provided by ES 2 won't allow this type of optimisation as you are forced to do more on the CPU side.
Cheers, Sean _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development