Re:Deprecation of OpenGL and OpenCL
by fulafel on Tuesday June 05, 2018 @12:40AM
(#17235042)
The non-deprecated OpenGL code for a hello world triangle is still an order of magnitude less verbose than Vulkan though.
[ Parent
| on HN ]
While Vulkan is a bit verbose, it's not an order of magnitude difference if you follow modern OpenGL best practices. If you rely on default state and use the default framebuffer and rely on implicit synchonization, you can squeeze it down to a few hundred lines but that's not a good foundation to build practical apps on.
To give a ballpark figure, my Vulkan "base code" is less than 2x what my OpenGL boilerplate is for the same functionality. The big difference: the Vulkan code is easy to understand, but the GL code is not.
Comparing "Hello World" doesn't make much sense, OpenGL gets really darn complicated once you get past the basics.
Vulkan code is extremely front-loaded. HelloTriangle is much longer. A complete application can be significantly shorter.
In my opinion a similar difference exists between CUDA and OpenCL. OpenCL takes more code to get something simple going. But at least it doesn't break if you upgrade your gcc or use a different GPU vendor.