Vulkan Tutorial (Rust)
kylemayes.github.io
kylemayes.github.io
Vulkan is so painfully verbose in unnecessary ways, forcing you to be explicit about everything, when in many cases, whole swaths of lines of code are unnecessary or the standard could have established sane defaults that match what actually happens in practice in the industry.
Maybe I'm in the minority here, I'm sure I probably am, but I see no reason to declare particular structures in both the standard and in tutorial documentation like vulkan-tutorial.com when they widely aren't going to be of use to anyone until you reach broad adoption or advanced usage.
Most of these tutorials should be helping you get to a triangle as fast as possible, but none of them follow the order of what you're exposed to in the reference material, and they all go on tangents about needing to state application info (not required), creating your own validation layers (this is advanced material, why recreate VK_LAYER_KHRONOS_validation???) or declare what device you're going to use (it's almost always going to be the first exposed device--even systems with discrete GPUs will only declare that they have one GPU available and hide the fact that they have an integrated GPU on the CPU).
It leads to hundreds of lines of code that distract from the high-level goals: initialize the renderer, set your shaders, upload assets to the GPU, and draw them.
I think the industry is still lacking reference-quality documentation outside of the reference specification, which doesn't explicitly help you with implementation details for the most common use cases.
I wouldn't expect it to, but it would have been nice. A lot of modern reference specifications do actually do this now.
It's my understanding that Vulkan (like Metal) has fundamentally different goals than OpenGL
OpenGL is like if the lowest-level programming language available on your OS was Java. Low-enough level to be fast-enough most of the time, and high-enough level to write application code with. When OpenGL was designed, it was common for eg. game developers to directly write OpenGL code as a part of their game
In today's world- we not only have higher-level libraries and APIs, but many eg. game developers use a game engine like Unity or Unreal and never touch the raw API. In this world, it makes sense to have that raw API be lower-level, so that the people maintaining the libraries and game engines can have more control and optimize those more deeply. Vulkan is the C to OpenGL's Java
(that's my understanding anyway; I've never been paid to do graphics programming)
If you understand one of the standards, the knowledge carries over to others.
Most game engines will abstract away shader attributes, but if you're not aware of how to define them, you're probably not writing them, either. So even if you're not touching glGetAttribLocation/vertex attribute APIs, you still actually have to know how to use them. Otherwise, the assumption is that you're only ever going to be able to use basic predefined rendering information exposed from the host game engine.
There's a bunch of other information like that which you have to be somewhat aware of once you step outside the bounds of "just draw this for me" with the host's default shaders.
3D APIs have a lot more uses than game development. Even though I'm also coming out of the game dev world and can understand the reasons, it is a real shame that game engine rendering engineers had so much influence in the design of modern 3D APIs, because it's hard to find a community that's more imprisoned in ivory towers of their own design ;)
A lot of what you request can be achieved by using Vulkan wrappers that simplifies these things without making the driver API more magic/implicit and regress back to the dx9/openGL style API's that mantle/vulkan/dx12 was made in opposition of.
99% of tutorial readers are going to grab the first device exposed to them. On a system with a discrete GPU, which is what most people will want to use, they'll pick that. When it's not available, an integrated device will be exposed.
You will almost never need to actually query for more device information.
If you're working through a tutorial, you will almost never need to actually write your own validation layers.
etc.
Edit: A lot of these tutorials do things that you don't need to do simply because they read it from another tutorial! I seriously doubt everyone is actually reading the reference specification.
All of this to say: I fully agree. The Vulkan tutorials I've found have put me off ever trying to use it again. I'm sticking to Metal which is much easier to understand and a delight to use.
Without middleware I would rather stick to a proprietary API than deal with Vulkan.
Pity that it misses out on the tooling from the other SDKs.
Seems like it’ll be a perfect match for rust then
[1]: https://www.fasterthan.life/blog/2017/7/11/i-am-graphics-and...
Conceptually it's the same as Vulkan it's just a lot less pain in the ass to work with.
In their defense, Metal predates Vulkan by a couple of years and I would say that Metal jump started the new generation of GPU APIs.
Metal also predates the nice present of AMD's Mantle to Khronos, which otherwise would still be arguing today what OpenGL vNext would look like.
I’d highly recommend using vulkano
It’s not stable but it’s useable. It’s actively developed. It’s quite a joy to use actually, feels like a rust library rather than a bunch of foreign function calls.
But to the point, would this open OpenGL with Rust libs to be a new entry in the ML development space?