mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #110063 from stuartcarnie/109846/ios_crash
Metal: Reduce baked version to MSL 3.1; validate minimum version
This commit is contained in:
commit
280503b4ee
3 changed files with 10 additions and 1 deletions
|
@ -102,3 +102,7 @@ private:
|
|||
extern os_log_t LOG_DRIVER;
|
||||
// Used for dynamic tracing.
|
||||
extern os_log_t LOG_INTERVALS;
|
||||
|
||||
_FORCE_INLINE_ static uint32_t make_msl_version(uint32_t major, uint32_t minor = 0, uint32_t patch = 0) {
|
||||
return (major * 10000) + (minor * 100) + patch;
|
||||
}
|
||||
|
|
|
@ -1137,6 +1137,11 @@ RDD::ShaderID RenderingDeviceDriverMetal::shader_create_from_container(const Ref
|
|||
RDD::ShaderID(),
|
||||
"Shader was generated with argument buffers, but device has limited support");
|
||||
|
||||
uint32_t msl_version = make_msl_version(device_properties->features.mslVersionMajor, device_properties->features.mslVersionMinor);
|
||||
ERR_FAIL_COND_V_MSG(msl_version < mtl_reflection_data.msl_version,
|
||||
RDD::ShaderID(),
|
||||
"Shader was compiled with a newer version of Metal than is available on the device.");
|
||||
|
||||
MTLCompileOptions *options = [MTLCompileOptions new];
|
||||
uint32_t major = mtl_reflection_data.msl_version / 10000;
|
||||
uint32_t minor = (mtl_reflection_data.msl_version / 100) % 100;
|
||||
|
|
|
@ -79,7 +79,7 @@ const MetalDeviceProfile *MetalDeviceProfile::get_profile(MetalDeviceProfile::Pl
|
|||
} break;
|
||||
}
|
||||
res.features.mslVersionMajor = 3;
|
||||
res.features.mslVersionMinor = 2;
|
||||
res.features.mslVersionMinor = 1;
|
||||
}
|
||||
|
||||
return &profiles.insert(key, res)->value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue