News for hackers. Stuff that matters.
Re:Vulkan Memory Allocator by codefreakxff on Wednesday July 21, 2021 @09:17AM (#27905812)
I completely agree. I recently decided to try learning Vulkan. I built an sdl window framework and got an OpenGL triangle in maybe 6 lines of OpenGL code. For vulkan you literally cannot draw anything until your reimplement an entire rendering engine from probing hardware, to figuring out queuing strategies, and resource management, etc. you are forced to focus your on HOW rather than WHAT to draw. I think they set the barrier of entry way too high. From a newbie perspective I’d rather have the library make smart decisions by default so I can just init and draw. But if I wanted to do more I could.
Re:Vulkan Memory Allocator by slavik81 on Wednesday July 21, 2021 @09:54AM (#27906283)
It takes dozens of lines of code to draw a triangle in modern OpenGL. You were presumably using immediate mode, which is ancient and deprecated because it has horrible performance on modern hardware. Given that the whole point of an API for hardware accelerated graphics is better performance, that's a big problem.

Immediate mode OpenGL not even a particularly friendly API, either. I found its implicit global mutable state for things like the matrix stack to be deeply confusing. There's much better drawing libraries out there if what you're looking for is ease-of-use.

Re:Vulkan Memory Allocator by tl on Wednesday July 21, 2021 @10:06AM (#27906473)
The removal of immediate mode from OpenGL is one of many examples of modern OpenGL's stupidity, partially responsible for creating the mess we're in:

https://www.jwz.org/blog/2012/06/i-have-ported-xscreensaver-...

Re:Vulkan Memory Allocator by slavik81 on Wednesday July 21, 2021 @10:34AM (#27906822)
Immediate mode still exists and is usable to this day. The compatibility profile never went away.

JWZ implemented old-school OpenGL in a library on top of a more modern API, and I would entirely agree that's a good approach to compatibility. I'd have advocated for doing the same thing, just without calling everyone idiots.

Re:Vulkan Memory Allocator by skohan on Wednesday July 21, 2021 @12:30PM (#27908390)
Immediate mode makes no sense from a performance standpoint. But you can still use it in 2021 if you want. I believe it's still supported mostly for CAD programs which haven't changed their core software since the 80's
Re:Vulkan Memory Allocator by dangerbird2 on Wednesday July 21, 2021 @02:04PM (#27909783)
And if you like the immediate mode API, just use something like raylib's rgl[1] that emulates an immediate-mode API on modern OpenGL. Aside from performance benefits, you can port your code to GLES or WebGL, where immediate-mode isn't present.

[1] https://github.com/raysan5/raylib/blob/master/src/rlgl.h

Re:Vulkan Memory Allocator by MegaDeKay on Wednesday July 21, 2021 @10:51AM (#27907080)
I'm willing to bet that much of that extra code you talk about is the boilerplate code that every Vulkan tutorial tells you is boilerplate code. After that boilerplate is cut and pasted in and you have your first triangle, what is the incremental in drawing a second triangle?