3 ms·
Tons of it is just boilerplate, because Mantle has no default. For instance, createTargetStates() is a ~50 lines function to set the MSAA, viewport, color blend
by alricb 12y ago
Tons of it is just boilerplate, because Mantle has no default. For instance, createTargetStates() is a ~50 lines function to set the MSAA, viewport, color blending, raster and depth stencil states, which mostly have default values in OpenGL.
The API is relatively straightforward, but you have to do almost everything yourself: you need to put your commands in command buffers, you have to allocate memory yourself, and you need to create your pipeline and use descriptor sets to bind your resources (triangles, textures) to it.
So it's not like old-school OpenGL where you could glBegin() and start doing stuff immediately, but it's only really painful at the start; you'll soon abstract away most of the boilerplate, and the main hurdle will be to have to manage your memory and bindings yourself.
I'm sure once Vulkan is released there will soon be libraries that take care of the boilerplate for you and offer some help to manage memory, bindings and command buffers.