Live data from Hacker News

Vulkan1.3 on the M1 in one month

rosenzweig.io

111–120 of 372 posts

Re: Vulkan1.3 on the M1 in one month

#111

Hacker News regularly makes me feel very stupid, and none more so than blog posts by Alyssa Rosenzweig. I couldn't even write an engine that used Vulkan in six months, nor a software rasteriser; meanwhile, Alyssa wrote an entire compliant driver on a non-native operating system running on locked-down hardware in one month flat. What am I doing with my life? EDIT: I point this out because I'd eventually like to write…

Writing an engine from scratch is debatably more complicated since you need to do a lot of guesswork around what capabilities you actually need and how badly the artists and gameplay programmers will break everything - assuming your not doing it all solo.

Re: Vulkan1.3 on the M1 in one month

#112

Their shaders contain a peculiar construction: if (condition) { while (true) { } } condition is always false, but the compiler doesn’t know that. What is the purpose of this other than to be a poison pill for people writing compliant shader compilers?

Maybe an edge-case in some codegen?

Re: Vulkan1.3 on the M1 in one month

#113

Hacker News regularly makes me feel very stupid, and none more so than blog posts by Alyssa Rosenzweig. I couldn't even write an engine that used Vulkan in six months, nor a software rasteriser; meanwhile, Alyssa wrote an entire compliant driver on a non-native operating system running on locked-down hardware in one month flat. What am I doing with my life? EDIT: I point this out because I'd eventually like to write…

Experience is everything.

Re: Vulkan1.3 on the M1 in one month

#114
post #7

Earlier quoted context omitted.

Vulkan would likely not really have helped macOS gaming in any form. I consider it a red herring that people point to. The number of games that run natively on Vulkan is negligible. The number of games that run on Metal by comparison (natively) is orders of magnitude higher. If we're ONLY talking about the ability to use Proton, Apple does now have Game Porting Toolkit that does effectively the same thing with compar…

> The number of games that run natively on Vulkan is negligible. Yep, that's unfortunately true... https://www.carette.xyz/posts/state_of_vulkan_2024/

these days, is the way to win in the industry to basically pour money into the popularity contest of your own dev kit vs. Nvidia's and others?

Re: Vulkan1.3 on the M1 in one month

#115
post #62

A very large part of me is annoyed that Apple didn't open source Metal before Vulkan was released. OpenGL definitely was annoying to work with, but Vulkan is impossible for the average user to do anything with; drawing a spinning cube takes several hundred lines of code, which I've written and I still don't really understand! I realize that Vulkan isn't meant for a "humans" to write, it's basically meant to be a targ…

I wonder how feasible a Metal compatibility library wrapped around Vulkan would be? That way you could use Metal on other platforms.

Also, what is the best resource for learning Metal if all you know is some OpenGL 1.x from the old “Lego” book?

Re: Vulkan1.3 on the M1 in one month

#116
If you're unfamiliar with Vulkan 1.3 but are interested in low level graphics API work, you should check it out. It is a game changer and a huge difference to Vulkan 1.0.

Once past the initial hurdle it's a pleasure to work with, with all dynamic states and no render pass up front set up, it is much easier to work with, even easier than OpenGL (which I've used for 20 years). Graphics programming is fun again.

It's available, or at least most of the features, on all desktop platforms with GPUs less than 10 years old give or take as long as drivers are up to date.

Unfortunately there is no "reasonable defaults" framework to get you off the ground but there are a lot of useful helper libraries for several languages.

Re: Vulkan1.3 on the M1 in one month

#117
post #81

Earlier quoted context omitted.

I think you make a good point in general, but "likely not really have helped macOS gaming in any form" I think is taking it too far. The reason why many developers only use dx11/12 is because adding more graphics backends increases their support surface unnecessarily, being that Vulkan only works on Windows (and Linux), while dx11/12 work on Windows on Xbox. As an extreme example of this, apparently Cyberpunk 2077 ra…

Many engines support Metal, in addition to the plethora of console specific APIs. Saying DX11/12 works on Xbox is glossing over that that it's not actually the same DX12 that works on desktop. You then say that if they used Vulkan, it would mean they wouldn't have to debug on a Mac. This is overly optimistic. Even in the OpenGL days, you'd have to test on all platforms because there's so many variances. In general, t…

>if they used Vulkan, it would mean they wouldn't have to debug on a Mac.[...] Neither should or would be blindly trusting that things are portable

I didn't mean this, just that you can actually run whatever shaders you compile rather than needing a Mac just to see your output. My point was that you would get "a smoother developer experience," which is true.

> Vulkan/DX on AMD/NVIDIA also perform differently enough that you can't just assume parity.

Vulkan has some pretty strict conformance tests[0]. It's not like you are going to run into differences between conformant Vulkan implementations every day. It's very different from not being able to run the shaders you've compiled at all. You just need to know what extensions are supported. Also, Apple's support for OpenGL was never good. They only supported OpenGL 4.1 for years while 4.5 was out, for example. I don't know if Apple's OpenGL was ever even conformant, being that 4.1 is not listed on the site.[1]

>There's no current Vulkan or DX backend for it.

There is actually (as an experimental feature currently).[2] And Khronos did not have to send developers to implement it for them. My understanding is that Blender also implemented CUDA/Optix themsleves and only got help from Nvidia, rather than Nvidia implement the whole thing for them, although I could easily be wrong there.

>This didn't prove itself out when OpenGL was a thing. OpenGL was everywhere but barely used.

OpenGL was not nearly as performant as direct X. When Direct X came out people switched to it. Vulkan and dx12 are very similar however.

> That doesn't mean that Vulkan would replace it though

Yeah, because each console wants their own special graphics API to force on everyone instead of using an open standard, despite Xbox and Playstation GPUs being from AMD which supports Vulkan on it's consumer GPUs.

>Many engines support Metal, in addition to the plethora of console specific APIs

And many don't, including the engines of a lot of AAA games like Elden Ring, Cyber Punk 2077 and Baldur's Gate 3 (although CDPR are now switching to UE5). And studios are generally using modified versions of UE so my guess is that means they are generally making low level changes sometimes, and so it makes sense to me that they sometimes may write their Dx/ Vulkan code for different things sometimes. (this is just my guess. I admit to being uninformed here). Even if not there are still ways that you could program something in UE without writing any direct DX/Vulkan code that could still result in worse performance for one of the backends vs. the other. That is why on games that support multiple graphics backends oftentimes one is better than the other. And developers will release updates improving only certain backends. Adding an extra platform like MacOS is not simply clicking a button. although it is easier today than before, if it was that simple, then literally every UE game would be on MacOS. (Yes, you do 'just click a button' to support MacOS in UE5, but there is still more to it than that.) And increasing the surface area of platform divergence does nothing to help the situation. Also, while it doesn't matter for Apple, having to maintain multiple backends adds needless extra work for engine developers

[0] https://docs.vulkan.org/guide/latest/vulkan_cts.html

[1] https://www.khronos.org/conformance/adopters/conformant-prod...

[2] https://code.blender.org/2023/10/vulkan-project-update/

Re: Vulkan1.3 on the M1 in one month

#118

Hacker News regularly makes me feel very stupid, and none more so than blog posts by Alyssa Rosenzweig. I couldn't even write an engine that used Vulkan in six months, nor a software rasteriser; meanwhile, Alyssa wrote an entire compliant driver on a non-native operating system running on locked-down hardware in one month flat. What am I doing with my life? EDIT: I point this out because I'd eventually like to write…

I often also feel imposter syndrome. But it's also good to realize that some people are just better at things than others, others have more free time, more motivation, more experience, etc.

Don't let other people's success bring you down.

Of course I've been dealing with imposter syndrome my whole life because my older brother is a genius and it's taken me my whole 44 years of life to try not to compare myself to him.

Re: Vulkan1.3 on the M1 in one month

#119
post #77
post #58

Earlier quoted context omitted.

Direct3D means only Windows and Xbox. Vulkan means everything non-Apple except Xbox and PlayStation. It's not everything, but it's a larger base.

What's larger than Windows + Xbox + Playstation for AAA games?

No single 3D API is capable of supporting all 3 of those platforms. However, if those are the only 3 you're concerned with, then Direct3D gets you farther (Windows+Xbox) than Vulkan (Windows only). You're still going to have to write/use something different for PlayStation (which has its own custom API).

The two major platforms that favor Vulkan are Android and Switch, but the former is in the "mobile" category rather than the "desktop/console" category and few games overlap both categories.

But really, Asahi Linux on M1 Mac is about as niche as you can get, so broad hardware support for native APIs isn't really relevant, and I don't think AAA games are necessarily what's meant to be supported either, since they generally won't work for other reasons (can't install x86-64 Windows kernel driver DRM/anticheat on an ARM Linux machine).

Re: Vulkan1.3 on the M1 in one month

#120

Hacker News regularly makes me feel very stupid, and none more so than blog posts by Alyssa Rosenzweig. I couldn't even write an engine that used Vulkan in six months, nor a software rasteriser; meanwhile, Alyssa wrote an entire compliant driver on a non-native operating system running on locked-down hardware in one month flat. What am I doing with my life? EDIT: I point this out because I'd eventually like to write…

Maybe you’re just enjoying it rather than spending all your waking time writing code?
Post reply on HN