Posts

Post not yet marked as solved
3 Replies
652 Views
Hi, we have the following question about the Metal:During migrating from OpenGL to Metal we have replaced each glDrawArrays() call by creation of the MTLRenderCommandEncoder with seeting of all required parameters and later calling of the drawPrimitives method. As a result if our scene contains more than 2000 MTLRenderCommandEncoders, our FPS falls to 4. At the same time all documentations requirenments were met: https://developer.apple.com/documentation/metal/mtlrendercommandencoder, i.e. reusing of the MTLDepthStencilState and MTLRenderPipelineState, creating of the MTLBuffer with option MTLDepthStorageModelPrivate.I want to add that I our area we often deal with the 2D data, i.e. with a significant number of small objects (polylines, circles, NURBS etc). Certainly, the large number of glDrawArrays() calls are also bad for OpenGL performance. But from our experince problems begins with dozens or even hundreds of thousands of objects. Here we have a problem already with 2000 of objects. It looks like we misunderstood something, that’s why we want to ask about the right strategy of working with MTLRenderCommandEncoder.Here is a screeen shoot of our test 2D file. Here we have about 2300 MTLRenderCommandEncoders and the FPS about 3-4.Many thanks in advance for any assistance.
Posted
by antonyter.
Last updated
.