mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Metal: Ensure baking to binary sets minimum target OS
Co-authored-by: Travis Lange <travislange12@gmail.com>
This commit is contained in:
parent
6c9aa4c7d3
commit
b7aac81366
14 changed files with 250 additions and 44 deletions
|
|
@ -54,7 +54,7 @@ bool ShaderBakerExportPlugin::_is_active(const Vector<String> &p_features) const
|
|||
return RendererSceneRenderRD::get_singleton() != nullptr && RendererRD::MaterialStorage::get_singleton() != nullptr && p_features.has("shader_baker");
|
||||
}
|
||||
|
||||
bool ShaderBakerExportPlugin::_initialize_container_format(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features) {
|
||||
bool ShaderBakerExportPlugin::_initialize_container_format(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features, const Ref<EditorExportPreset> &p_preset) {
|
||||
Variant driver_variant = GLOBAL_GET("rendering/rendering_device/driver." + p_platform->get_os_name().to_lower());
|
||||
if (!driver_variant.is_string()) {
|
||||
driver_variant = GLOBAL_GET("rendering/rendering_device/driver");
|
||||
|
|
@ -67,7 +67,7 @@ bool ShaderBakerExportPlugin::_initialize_container_format(const Ref<EditorExpor
|
|||
|
||||
for (Ref<ShaderBakerExportPluginPlatform> platform : platforms) {
|
||||
if (platform->matches_driver(shader_container_driver)) {
|
||||
shader_container_format = platform->create_shader_container_format(p_platform);
|
||||
shader_container_format = platform->create_shader_container_format(p_platform, get_export_preset());
|
||||
ERR_FAIL_NULL_V_MSG(shader_container_format, false, "Unable to create shader container format for the export platform.");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ bool ShaderBakerExportPlugin::_begin_customize_resources(const Ref<EditorExportP
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!_initialize_container_format(p_platform, p_features)) {
|
||||
if (!_initialize_container_format(p_platform, p_features, get_export_preset())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ShaderBakerExportPluginPlatform : public RefCounted {
|
|||
GDCLASS(ShaderBakerExportPluginPlatform, RefCounted);
|
||||
|
||||
public:
|
||||
virtual RenderingShaderContainerFormat *create_shader_container_format(const Ref<EditorExportPlatform> &p_platform) = 0;
|
||||
virtual RenderingShaderContainerFormat *create_shader_container_format(const Ref<EditorExportPlatform> &p_platform, const Ref<EditorExportPreset> &p_preset) = 0;
|
||||
virtual bool matches_driver(const String &p_driver) = 0;
|
||||
virtual ~ShaderBakerExportPluginPlatform() {}
|
||||
};
|
||||
|
|
@ -82,7 +82,7 @@ protected:
|
|||
|
||||
virtual String get_name() const override;
|
||||
virtual bool _is_active(const Vector<String> &p_features) const;
|
||||
virtual bool _initialize_container_format(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features);
|
||||
virtual bool _initialize_container_format(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features, const Ref<EditorExportPreset> &p_preset);
|
||||
virtual void _cleanup_container_format();
|
||||
virtual bool _initialize_cache_directory();
|
||||
virtual bool _begin_customize_resources(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue