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

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

Closed
TheDevTeam2 opened this issue Dec 23, 2024 · 2 comments · Fixed by #11695
Assignees

Comments

@TheDevTeam2
Copy link

I apologize if this has already been reported or fixed, I tried searching open and closed issues for it but didn't find anything. I'm using the new GPU interface, which I am brand new to, so it may be some kind of user error on my end as well.

My code works fine on MacOS, but on iOS in the simulator, when SDL_BindGPUGraphicsPipeline is called, it gives the error:

"MTLValidateFeatureSupport:6991: failed assertion `Depth Clip Mode is not supported on this device'"

I have tried a lot of different configurations for the graphics pipeline, including various formats for the depth buffer, enabling and disabling the depth buffer and so on, and nothing seems to affect this error message. So it may be an actual bug rather than user error on my part. I believe this error is coming from line 2378 of SDL_gpu_metal.m:

if (@available(iOS 11.0, tvOS 11.0, *)) {
            [metalCommandBuffer->renderEncoder setDepthClipMode:SDLToMetal_DepthClipMode(metalGraphicsPipeline->rasterizerState.enable_depth_clip)];
        }

In theory, this line should work fine on iOS in the simulator. I have the simulator set to iOS 18.1, which is well beyond iOS 11. I have seen a few reports online of getting this error when using metal in the iOS simulator, so it may be specific to the emulator.

This error comes from API validation specifically: if you turn off iOS API validation, then the code runs fine. However, I doubt it would get past the iOS App Store checks if it can't pass API validation in the simulator.

I am using SDL 3.1.6, so I haven't tried this on main. I'm using a Mac mini M4 running MacOS 15.2, Simulator version 16 (1038), using Xcode.

Thank you for your time looking into this, and I apologize again if this has already been fixed.

@TheSpydog
Copy link
Collaborator

This isn't related to the OS version, it's related to the hardware. The iOS Simulator is roughly equivalent to an A8 chip, which is the cutoff point for SDL_GPU's support -- it only supports A9 and higher.

However, we should try to explicitly check the hardware version earlier in the process so the error is more clear (and document this limitation somewhere).

@TheSpydog TheSpydog self-assigned this Dec 23, 2024
@TheDevTeam2
Copy link
Author

Ahh, that makes sense, thank you so much for the quick reply!

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 a pull request may close this issue.

2 participants