News for hackers. Stuff that matters.
Re:Friday Facts #371 - Apple Silicon by candiddevmike on Friday November 25, 2022 @09:20AM (#33742598)
From what I understand, Apple decided to force Metal upon everyone instead of using Vulkan like the rest of the industry. This causes friction with game development.
Re:Friday Facts #371 - Apple Silicon by GeekyBear on Friday November 25, 2022 @09:34AM (#33742707)
> instead of using Vulkan like the rest of the industry

When did the rest of the industry drop Direct3D for Vulcan?

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @09:36AM (#33742718)
When DirectX became irrelevant: https://github.com/doitsujin/dxvk
Re:Friday Facts #371 - Apple Silicon by GeekyBear on Friday November 25, 2022 @09:57AM (#33742927)
Sorry, but this seems extremely disingenuous.

The industry uses Direct3D on Windows and XBox, Metal on Mac and iOS devices, Gnm on Playstation, and Nvn on Switch.

Aside from a subset of Android, what popular platform uses Vulkan by default?

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @10:01AM (#33742960)
If you want to claim that Direct3D is king, I'll agree with you. I'm merely pointing out that all of the DirectX libraries are fairly irrelevant when they run just fine without DirectX.
Re:Friday Facts #371 - Apple Silicon by ohgodplsno on Friday November 25, 2022 @01:51PM (#33745564)
Ooof, I've seen some bad takes but this one is a really bad one.

DXVK is currently only used as a drop in replacement for DX9 games. DX10 has been forgotten (thank god), DXVK's D3D11 implementation is not good, and more and more games are going on D3D12 which affords a hell of a lot of control.

Additionally, DirectX is not just a graphics API, it's also sound (XACT and XAudio2), ray tracing (DXR), Input handling (XInput & DirectInput), CUDA-like calculations (DirectCompute), storage handling (DirectStorage), etc. Most of these have either an alright equivalent (DXR has an equivalent in Vulkan with extensions, and that's about it, and Valve's input implementation is _really good_, but it's not a usable API as far as I know.) or a wildly inferior alternative (at least for the PC space that is Windows/Linux/MacOS). D3D12 also is one of the drivers of new GPU programming features in the PC space (once again, the console side of things is a bit weirder, although MS does bring some lessons in from the Xbox side of things), while Vulkan is kind of stuck doing everything as extensions that may or may not be available, and Metal is still a piece of shit.

So, yeah, no, DirectX is far from irrelevant.

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @09:23AM (#33742622)
That's part of the problem. MacOS actually had the same Proton compatibility layer as Linux a few years ago, but with Catalina Apple changed what you're allowed to run on your Mac and it broke completely. Neither Valve nor Codeweavers have gotten DXVK or Proton to run on MacOS since, IIRC.
Re:Friday Facts #371 - Apple Silicon by gjsman-1000 on Friday November 25, 2022 @09:48AM (#33742837)
Apple depreciated 32-bit, a year before Apple Silicon came out, which allowed them to more precisely target 64-bit processor speed without legacy baggage. Apple Silicon on iOS had dropped 32-bit years before and they didn’t want to bring it back for macOS.

Android is following with 32-bit deprecation this year, actually. Pixel 7 doesn’t support 32-bit apps.

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @10:06AM (#33742997)
Real shame, Diablo 2 still runs great on modern hardware.
Re:Friday Facts #371 - Apple Silicon by sirn on Friday November 25, 2022 @09:56AM (#33742913)
That doesn't sound right. Codeweavers has been shipping fairly recent version of DXVK alongside with MoltenVK since CrossOver 20. On community side there's Gcenx/DXVK-macOS[1] that patched DXVK to work with some of Apple GPU quirks in some games and closely track upstream.

[1]: https://github.com/Gcenx/DXVK-macOS

Re:Friday Facts #371 - Apple Silicon by mcphage on Friday November 25, 2022 @09:25AM (#33742634)
> From what I understand, Apple decided to force Metal upon everyone instead of using Vulkan like the rest of the industry

Metal came out in 2014, Vulkan in 2016.

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @09:28AM (#33742651)
That doesn't really change anything. If Apple uses a bad API because they thought of it first, they're still using a bad API.
Re:Friday Facts #371 - Apple Silicon by robertlagrant on Friday November 25, 2022 @09:32AM (#33742680)
This seems disingenuous. The previous claim was that Apple ignored an existing emerging standard, so it is relevant. Your new claim is that Metal is a bad API, which I haven't heard anyone else say. What makes it bad?
Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @09:34AM (#33742705)
My larger point is that Apple can obviously support both APIs. It doesn't matter if Metal is good, bad or even awful, Vulkan is what people are using and Vulkan can translate from DirectX. Apple is shutting themselves off from the rest of the industry with this move, which I would argue (judging by how many Mac users wish they could game) is a bad thing.
Re:Friday Facts #371 - Apple Silicon by robertlagrant on Friday November 25, 2022 @10:28AM (#33743225)
> It doesn't matter if Metal is good, bad or even awful

I'm confused. Your previous statement was saying the main point is that Apple have kept a bad API.

> Vulkan is what people are using and Vulkan can translate from DirectX. Apple is shutting themselves off from the rest of the industry with this move, which I would argue (judging by how many Mac users wish they could game) is a bad thing.

Possibly, FSVO translate, but I don't think anyone was commenting on this new point. More with the previous points.

Re:Friday Facts #371 - Apple Silicon by saagarjha on Friday November 25, 2022 @09:30AM (#33742668)
Metal is generally a nicer API to use than Vulkan.
Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @09:31AM (#33742677)
It could cook my breakfast for me, and it would still be useless if it exclusively targets Apple products. People use Vulkan because it targets multiple platforms. There's nothing stopping Apple from providing both APIs, and if Apple's API is truly nicer to use than Vulkan, then Apple has nothing to worry about.
Re:Friday Facts #371 - Apple Silicon by jmull on Friday November 25, 2022 @10:12AM (#33743045)
Vulkan is counter to Apple's vertical integration approach. It would be a foundational API, sitting between their graphics hardware and their OS, yet one they don't control.

Better for someone else to build a Vulkan API on top of Metal, which is what has happened. It's not perfect, but it's the only thing that can work. The pressure on Apple should be for Metal to better support Vulkan by providing APIs it needs to work optimally.

Beyond that, Apple might want to contribute to the Vulkan-on-Metal implementation... though they're only going to do that if it makes strategic sense, which I don't see. For cross-platform, what makes more sense is to encourage games to use a higher-level engine that supports metal among its platforms, like Unity and Unreal.

Re:Friday Facts #371 - Apple Silicon by smoldesu on Friday November 25, 2022 @10:23AM (#33743159)
Well, thus-far it has failed. We have Factorio, Tomb Raider and one of the Resident Evil games running on MacOS - most of which had to implement Metal by hand. If you're right, Apple's strategy needs to change.
Re:Friday Facts #371 - Apple Silicon by acdha on Friday November 25, 2022 @10:50AM (#33743455)
And a ton of other games because things like Unity make that easy. If you aren’t focused on AAA, you should have no problems finding more games than most of us have time for.
Re:Friday Facts #371 - Apple Silicon by yisonPylkita on Friday November 25, 2022 @10:54AM (#33743517)
I want to mention here that Factorio doesn't use Apple Metal API. They use OpenGL and Apple dropped OpenGL in favour of Metal
Re:Friday Facts #371 - Apple Silicon by jmull on Friday November 25, 2022 @11:35AM (#33744047)
The thing is, you need a whole game to work on macos, not just the graphics. Vulkan is just a cross-platform graphics API, not a cross-platform framework.

Typically, if a game maker wants to make cross-platform a priority, they wouldn't target just Vulkan, they'd target a cross-platform framework. That would be true whether Vulkan was supported by Apple or not. And if they don't make cross-platform a priority, the chances of a mac port go down regardless.

So...

We're looking at the incremental gain of Apple providing first-party support for Vulkan vs the existing third-party support. Looks like a lot of work for Apple for little gain. Just doesn't seem worth it to me. Also, the Vulkan version would always be out-of-date since Apple would pin the supported version to an OS release, and would need to be conservative about it, since they aren't going to hold an OS release for Vulkan.

Really, Vulkan on macOS is much better done by the interested third parties, and the focus on Apple should be to get them to better support a Vulcan API on top of Metal.

Re:Friday Facts #371 - Apple Silicon by gernb on Friday November 25, 2022 @11:09AM (#33743693)
Can't devs who want to target Vulkan just use MoltenVK?

https://github.com/KhronosGroup/MoltenVK

Re:Friday Facts #371 - Apple Silicon by gjsman-1000 on Friday November 25, 2022 @09:47AM (#33742823)
Yes… and no.

Remember, to start, Windows only officially supports DirectX. OpenGL and Vulkan comes from your GPU vendor and Microsoft waives all responsibility for them. Vulkan is, quite literally, a 3rd-party API that can run on Windows - not something Windows supports or endorses.

Xbox does not support Vulkan. DirectX or get rejected.

Only 60% of Android devices support Vulkan. Guess you’ll also need ANGLE or OpenGL for backwards compatibility.

PlayStation does not support Vulkan. Better learn gnm, gnmx, and PSSL.

Nintendo Switch has Vulkan but it is almost unusably slow, on a console that is already not known for speed. Better use NVN if you want anything decent.

iOS does not support Vulkan. Better use Metal.

So… what does Vulkan support, exactly? Windows, Linux, and not enough of Android. If your game only runs on desktop, it’s a good option - but why not target DirectX? Windows, Linux with Proton, and most of the Xbox support all in one. For this reason, I have yet to see a Vulkan game that does not have a DirectX mode.

Blaming macOS for being proprietary is disingenuous in an industry full of Proprietary APIs.

Re:Friday Facts #371 - Apple Silicon by maccard on Friday November 25, 2022 @09:55AM (#33742908)
If you're _really_ aiming for cross platform support, an RHI is only the beginning of your problems though. Replacing the rendering code may not be _trivial_ but if you're stuck at that point you're likely going to struggle with networking, filesystem, permissions, user accounts, store requirements. Modern rendering APIs are _similar enough_ in feature sets and abstraction layers that it's not an insurmountable task.
Re:Friday Facts #371 - Apple Silicon by nickelpro on Friday November 25, 2022 @11:30AM (#33743963)
You're doing a bit of slight of hand on Windows support.

Windows doesn't "support" the DirectX version shipped by your GPU vendor either. The drivers shipped by your GPU vendor, and all the APIs provided by them, are supported by your GPU vendor.

So the real thing we're talking about is hardware vendors. Nvidia and AMD support Vulkan, OpenGL, and DirectX where applicable. Apple only supports Metal. The console vendors have always had weird variant APIs based on the open standards but not identical, except MS where the console is very close to desktop Direct X.

On mobile hardware vendors ubiquitously support OpenGL ES and there's widespread support for Vulkan.

So it's complicated. In the desktop space, as a percentage of market share, Vulkan is extremely widely supported. Same with mobile. Consoles have always been an odd man out.

So Apple, which doesn't sell a console, is absolutely breaking from the pack in the markets they target.

Re:Friday Facts #371 - Apple Silicon by gjsman-1000 on Friday November 25, 2022 @01:52PM (#33745570)
> Same with mobile.

If you consider 60% of Android users, and 0% of iOS users, "widely supported," sure. That's less than half of mobile phones in use right now, making Vulkan the odd-one-out on mobile as well. You certainly can't build a mobile app right now that only uses Vulkan without cutting out huge parts of your audience.

> So Apple, which doesn't sell a console, is absolutely breaking from the pack in the markets they target.

Apple wants the same API on all of their devices, and I can't blame them. They are the odd-ones-out in Desktop only.

But does that really matter? If you are making a game only for Desktop, namely Windows, and weren't going to just use DirectX for some reason, it does (which I think, nowadays, is a rare situation). But if you are targeting any game consoles, or any mobile phones, you're adding multiple graphics APIs anyway and Metal is just another one.

Re:Friday Facts #371 - Apple Silicon by nickelpro on Friday November 25, 2022 @11:48PM (#33750087)
> If you consider 60% of Android users, and 0% of iOS users, "widely supported," sure.

But that's what we're talking about, if it weren't for Apple Vulkan would be a near ubiquitous desktop and mobile API. Apple is the one standing in the way of that.

If Vulkan were a near ubiquitous mobile and desktop API, _maybe_ the console vendors would be more willing to tolerate it.

Re:Friday Facts #371 - Apple Silicon by dmitriid on Saturday November 26, 2022 @03:43AM (#33751067)
> if it weren't for Apple Vulkan would be a near ubiquitous desktop and mobile API

Ubiquitous desktop: Windows

Uniquitous gaming consoles: XBox and Playstation

Ubiquitous phones (worldwide): Android

APPLE IS RESPONSIBLE FOR VULKAN NOT BEING EVERYWHERE (not in Windows, not on XBox, not on Playstation, not on 40% of Android devices)

Re:Friday Facts #371 - Apple Silicon by BlueTemplar on Saturday November 26, 2022 @07:35AM (#33752150)
Microsoft can't be expected to just give up the gatekeeping that is DirectX on their own (well, maaaybe if antitrust was more effective ??).

Sony only cares about their console(s), so they prefer to focus on optimization rather than compatibility. (While Nintendo cares more about gameplay than graphics.)

Isn't that 40% of Android devices old / very cheap ?

Apple is one of the biggest (and especially, most profitable) companies in the world, and with great power comes...

Re:Friday Facts #371 - Apple Silicon by dmitriid on Saturday November 26, 2022 @09:17AM (#33752807)
So "Microsoft can't be expected", "Sony doesn't care" but we should only blame Apple. Gotcha.

Because only Apple has the power and hence the responsibility, not the tiny helpless companies Microsoft and Sony (~99% of consoles, 76% of desktop).

Edit: don't forget, Apple absolutely must support Vulkan (and others don't) because Metal is proprietary and non-cross-platform (just like any other graphics API on all major platforms) even though Vulkan appeared two years later than Metal (but neither Microsoft nor Sony are expected to drop their APIs which also appeared earlier than Vulkan).

Did I get that logic right?

Re:Friday Facts #371 - Apple Silicon by ynx on Friday November 25, 2022 @04:13PM (#33746836)
> Only 60% of Android devices support Vulkan

Total addressable market matters here. 100% of Android-based VR headsets support Vulkan. Granted, that's mostly the Quest 2, but it's not the only HMD in town anymore.

Also, a lot lot lot of Android devices are garbage-tier <$100 that you wouldn't want to target anyways because you won't get any sales on them. So the % of Android devices supporting Vulkan may be misleading in the sense that you might be aiming for a segment of devices with much, much higher, if not complete, support for Vulkan.