Add min gpu family for baking apple shaders#116114
Add min gpu family for baking apple shaders#116114TCROC wants to merge 1 commit intogodotengine:masterfrom
Conversation
0511c6f to
fcad4b0
Compare
|
Some issues occurred when rebasing on master before I put in this PR. I'll touch these up tomorrow. But the concept is still the same if anyone wants to review |
There was a problem hiding this comment.
The issue is more complex than the min GPU, when baking shaders.
Unfortunately, when shaders are queried in the renderer, it asks the host platform for supported features, such as RD::SUPPORTS_IMAGE_ATOMIC_32_BIT (the primary culprit of the baking issues). On the host platform, this returns true. When baking the shader, the minimum GPU and Metal versions are passed to SPIRV-Cross, based on the MetalDeviceProfile. By default, the versions we pass do not support atomics, so it generates unsupported shader code, as SPIRV-Cross tries to emulate atomics.
Important
If the user specified a target OS of iOS 17 (Metal 3.1) for iOS, the baked shaders should work. For earlier OS versions, Godot should fall back to compiling the code.
|
I think the interim solution is to limit shader baking to iOS 17+ for the moment, so that it doesn't generate incorrect shader output. |
fcad4b0 to
f67943d
Compare
90407c6 to
ef57d7f
Compare
ef57d7f to
def1c7a
Compare
|
@bruvzg @stuartcarnie Also I updated |
This adds the ability to specify the minimum gpu family to bake apple shaders against. Currently our MacOS version has a higher gpu family than the iPhone XR supports. Hence when we bake our shaders, they don't run on the iPhone XR. This gives more granular support in the shader baking process and allows users to target older devices than their current Mac.