Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This might come off as a surprise to some people but getting good performance with Vulkan (compared to say OpenGL) isn't trivial because:

the Vulkan driver is missing that ~20k loc of code that OpenGL driver does for you to set up the rendering pipelines, render targets etc.

This is all code that already exists in the OpenGL driver and has been optimized for +20 years by the best people in the industry.

So when you start putting together the equivalent functionality that you get out of the box with OpenGL on top of Vulkan doing it the naive way doesn't magically give you good perf, but you gotta put in some more work and then the real problems start stacking up such as making sure that you have all right fences etc synchronization primitives in place and so forth.

So only when you actually know what you're doing and you're capable of executing your rendering with good parallelism and correct synchronization can you start dreaming about the performance benefits of using Vulkan.

So for a hobbyist like myself.. I'm using OpenGL ES3 for the simplicity of it and because it's already good enough for me and I have more pressing things to matter than spend time writing those pesky Vulkan vertex descriptor descriptor descriptors ;-)

Btw this is my engine:

https://github.com/ensisoft/detonator



I've heard the same thing about DirectX 12 vs DirectX 11. One book basically said that you will probably have worse performance in DirectX 12 vs DirectX 11 if you don't know what you're doing.


DirectX 12 only gets interesting when you want hardware raytracing support to make use of the new Nvidia cards on windows. Tbf that is pretty cool, which is why I actually dabbled with it a little. But it's not necessary for the vast, vast majority of graphics applications.


I wonder how much less ergonomic is is for getting there via Vulkan. For the ray tracing shaders.


the biggest part for me is the shader compiler. opengl has one built in, vulkan requires me to pull in yet another dependency

i've heard that vulkan allows bindless textures now, so the descriptor nonsense is a bit less awful that it used to be

vulkan is appealing, but there's a high initial cost that i don't want to pay


Vulkan is super appealing if you're in the industry and have the time and resources necessary to profit from its advantages. But if you're a single dev who wants to learn game engine design, you're going to have a bad time. Most people also don't get that game engine design is very far removed from actual game design. You can have a ton of fun learning math, physics and computer science when building an engine, but beware that you'll likely be mentally and physically exhausted long before you actually get to build a fun game.


>if you're in the industry and have the time and resources necessary to profit from its advantages.

I don't even know how you get into the graphics industry these days. The bar is so high and I just don't see how you get the knowledge needed for it. I graduated years ago and don't feel any closer now than back in the mid 2010's despite having a lot more experience to point to in other parts of games.


vulkan doesn't have global state, and the error handling is better

but it's not batteries-included, and that's often to be a deciding factor at small scales

i think if you're going to dabble in engine dev, you pick which one you want depending on which part of the engine you find interesting. if you want to make a game, you pick up unity or godot or something


Also in the case of glslang there are enough references to GPL to (probably erroneously) strike fear into legal departments


Could someone write an OpenGL to Vulkan layer as a library so that we can target Vulkan but at a higher level of abstraction?

Then gradually we can replace that library with routines optimised for the use case?


There is the Zink project[1]. It is an OGL to Vulkan translation layer.

[1]https://docs.mesa3d.org/drivers/zink.html


But it's part of Mesa, it's not something you can drop into an app written against OpenGL to translate the calls to Vulkan right?


You absolutely can. It can even build and run on Windows too. I’ve used it to play some modded Minecraft builds where Zink outperformed the native OpenGL2 drivers on my machine. Mainly because the native OpenGL2 driver was terrible at the time for my hardware but it’s 100% a thing you can do.

Some games are even shipping on it [1]

[1] https://www.gamingonlinux.com/2023/02/x-plane-12-now-uses-th...


Where do you think <GL/gl.h> comes from?


ANGLE is the (certified compliant) OpenGL ES -> Vulkan/Metal/Direct3D/etc translation layer used by your friendly neighborhood web browser. There are docs about how the Vulkan translation layer works: https://chromium.googlesource.com/angle/angle/+/HEAD/src/lib...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: