Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU: Document system requirements, add upfront Metal hardware support checks #11695

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

TheSpydog
Copy link
Collaborator

@TheSpydog TheSpydog commented Dec 24, 2024

This PR adds documentation for the OS/driver/hardware requirements for each of the SDL_GPU backends. This should hopefully clear up a lot of ambiguity around "is this device supported" and gives developers something concrete to use for their own system requirements and support.

At runtime, to ensure the device meets SDL_GPU driver's system requirements, Vulkan and D3D12 perform a series of feature support queries during the device creation process. However, for Metal, we only performed a single OS version check. This allowed apps to get pretty far into their lifecycle on unsupported devices before they crashed by using an unsupported feature.

To fix this, I've added hardware support queries as early as possible (right after MTLDevice creation) to detect if the app is running on an unsupported device, so that apps can handle the failure gracefully. I also bumped up the minimum macOS version from 10.13 to 10.14 because lower versions don't have the hardware support query we need.

Resolves #11692

Copy link
Collaborator

@flibitijibibo flibitijibibo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor things for the docs but none of them super important. Part of me wishes there was a way we could sneak in more mentions of console support since I'm sure people will ask, but there's probably a better way to advertise it elsewhere...

include/SDL3/SDL_gpu.h Show resolved Hide resolved
include/SDL3/SDL_gpu.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@thatcosmonaut thatcosmonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on mentioning Xbox and I think we should explicitly mention Vulkan on Nintendo as well. Otherwise looks great

@TheSpydog
Copy link
Collaborator Author

Updated to mention console support, and made the OS version requirements more explicit!

@TheSpydog TheSpydog force-pushed the metal-device-check branch 3 times, most recently from 71db1eb to f6b97f4 Compare December 24, 2024 04:53
@maia-s
Copy link
Contributor

maia-s commented Dec 24, 2024

I can't find any information about which devices support the Mac2 gpu family. Is it only supported on apple silicon?

@thatcosmonaut
Copy link
Collaborator

I've tested the GPU API on my 2012 Macbook Pro which has an Nvidia card in it, so maybe that's some indication? Apple is pretty unclear about this.

@TheSpydog
Copy link
Collaborator Author

The only place where Apple really defines what a "Mac2" device is is on the deprecated feature set page here. I've added a link to this page in the comment, hopefully that clarifies things. (We'll just have to hope that Apple doesn't take that page down anytime soon...)

@TheSpydog TheSpydog merged commit a27c139 into libsdl-org:main Dec 24, 2024
40 checks passed
@TheSpydog TheSpydog deleted the metal-device-check branch December 24, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDL3] GPU: iOS SDL_BindGPUGraphicsPipeline failed assertion 'Depth Clip Mode is not supported on this device'
5 participants