Live data from Hacker News

Vulkan1.3 on the M1 in one month

rosenzweig.io

121–130 of 372 posts

Re: Vulkan1.3 on the M1 in one month

#121

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…

One complicating factor is also there's a huge range of time required for different levels of quality.

Something that's quickly hacked together with limited error handling, limited security, limited flexibility/reusability, vs. something very high quality and enterprise quality.

Re: Vulkan1.3 on the M1 in one month

#122
post #56

> It begins with a text. > > Faith… I think I want to write a Vulkan driver. > > Her advice? > > Just start typing. I love this part. It is such great advice and it applies to so many things that we want to do in life, but never start because we become paralyzed with fear due to what seems to be an insurmountable task.

Exactly me feelings. I am inspired by the work Asahi Linux team publishes. As a full stack developer, I feel very very distant from this part of the stack. Everything looks like greek and latin. Reading this post gives me hope. May be I can someday understand how the drivers are written, I leave my fear and start writing and reading code.

Re: Vulkan1.3 on the M1 in one month

#123

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 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.

Apple Silicon Macs are explicitly not locked down, it's just that the hardware is totally undocumented. This means that there's no jailbreaking necessary, just a lot of reverse engineering (which is still very difficult of course).

From https://asahilinux.org/about:

> Apple allows booting unsigned/custom kernels on Apple Silicon Macs without a jailbreak! This isn’t a hack or an omission, but an actual feature that Apple built into these devices. That means that, unlike iOS devices, Apple does not intend to lock down what OS you can use on Macs (though they probably won’t help with the development).

Re: Vulkan1.3 on the M1 in one month

#124
post #102

Earlier quoted context omitted.

> What am I doing with my life? Not working on GPU drivers for third-party hardware? These blog posts are fun, but they're in the same genre as porting game boy emulators.

It takes more lines of code to draw a triangle in the screen with Vulkan than it takes to write a Gameboy emulator that can play Pokemon Blue. Vulkan is a modern stack, Gameboy isn't.

Wow.

  triangle.cpp
  1181 lines (1048 loc) · 56.2 KB

  z80.cpp
  493 lines (440 loc) · 19.3 KB
  
  z80.h
  37 lines (30 loc) · 720 Bytes
https://github.com/SaschaWillems/Vulkan/blob/master/examples...

https://github.com/rasky/cz80/blob/master/z80.cpp

Re: Vulkan1.3 on the M1 in one month

#125
post #7
post #4

Earlier quoted context omitted.

There will be a small bit of irony if the gaming experience on Asahi ends up easier and more straightforward than MacOS. Really just drives home how big of a mistake it was ignoring Vulkan for the past decade on Apple's behalf, but lord knows they won't admit that until it's too late.

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…

Vulkan probably wouldn't help macOS gaming from a users' point of view, but it sure would be nice for us engine developers. There aren't many Vulkan games, but the big 3 non-in-house game engines (Unreal, Unity, Godot) are all committed to supporting Vulkan in addition to Metal, so we (collectively, the engine dev community) currently have to support both. Dropping Metal would reduce the amount of engineer time spent chasing down Metal-specific bugs (which is not inconsequential), which allows us to spend more time on actually interesting features that users want.

Metal is a hidden tax that isn't obvious, but it's there.

Re: Vulkan1.3 on the M1 in one month

#126
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…

> You then say that if they used Vulkan, it would mean they wouldn't have to debug on a Mac. This is overly optimistic.

Sure, but supporting two variants of Vulkan is less work than having to support two incompatible APIs. It's not a binary thing.

Re: Vulkan1.3 on the M1 in one month

#127
post #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 av…

Is there any tutorial/documentation to get started with Vulkan 1.3 specifically? Last time I looked, all I found was a hodgepodge of techniques using old and new methods haphazardly in various combinations. Though that is exactly how OpenGL used to be, so maybe the apple (heh!) doesn't fall far from the tree. Well done, Khronos...

Re: Vulkan1.3 on the M1 in one month

#128

I wonder if this effort to add Vulcan to Linux and then translate DirectX in Asahi Linux would impact Apple's dream of landing AAA games on Apple Silicon. Apple would like AAA developers to port their AAA games over to Metal so that the game has one code base but can run on iPhones, iPads, Macs, and the Vision Pro. Perhaps Mac gamers will install Asahi Linux in order to play AAA PC titles.

Pretty much, Asahi Linux could become the new Bootcamp for Mac users who dual booted to play games. FWIW I played Diablo II Resurrected on a M1 with "Whiskey". I was quite impressed that I was able to play a native Windows game just like that. It doesn't work anymore just because a stupid Blizzard launcher update now crashes and prevents starting the game. I also ran EverQuest II admittedly an old DX9 game but still…

Just buy Crossover, then Diablo runs fine on MacOS again!

Re: Vulkan1.3 on the M1 in one month

#129

Is any of this usable from within a VM? I dev on macOS and generally like it, but run a VMware image of Ubuntu for testing things. I do 3D graphics apps, and I’m not sure how good VMware’s pass through is. Is the Apple Silicon GPU virtualized in the VM? Could I run this distro and get better graphics performance?

No you have to install native. Also Parallels is way better than VMware, if you want good 3D performance inside a Windows/Linux/MacOS VM on MacOS.
Post reply on HN