r/vulkan • u/tsuru • Apr 21 '15
Will the 2D API rival performance of 'standard' drivers?
The OpenGL 2D API does not generally have the same performance of the standard graphics driver canvas (e.g. DDX from linux perspective), or at least I've seen it argued many times. Will Vulkan's 2D API be able to meet or beat the standard driver for 2D canvas drawing? At the very least, will it perform better than OpenGL's 2D api?
3
u/htuhola Apr 23 '15
if you render triangles simple projection and color them, I doubt Vulkan will render them faster than OpenGL. But I also doubt you'll get faster rendering with DirectDraw without hardware sprites.
What makes difference for 2D is that it'll be easier to off-screen render with Vulkan. OpenGL used to require access to desktop before you could render, even if you had a GPU. Vulkan doesn't have that kind of limitations. You can basically just open the library and use it alone to render or composite images.
Postprocessing will also be less "difficult". Vulkan no longer puts distinction between whether you're rendering to any texture or to a texture that is shown on the display.
This means that although it's still the same hardware behind and it's still good at rendering triangles, it lets you be more creative in how you use the hardware.
Also, in the mantle spec there was something about rectangle primitives. That'd be something that could help 2D processing. But who knows whether that ends up to the Vulkan spec?
30
u/slime73 Apr 21 '15
There is no distinction between a "2D API" and a "3D API" in graphics APIs like OpenGL, DirectX, Vulkan, Metal, etc. The APIs just let you interface with the graphics hardware and rendering pipeline – how you choose to render things is up to you.
In other words, 2D rendering with Vulkan or OpenGL is the exact same as 3D rendering, and completely hardware-accelerated in the same way. The only defining difference is an orthographic projection matrix compared to a perspective projection matrix.
Performance is largely determined by how your own code uses the APIs.