diff --git a/drivers/metal/rendering_device_driver_metal.cpp b/drivers/metal/rendering_device_driver_metal.cpp index a989f99b5f29..672998c161de 100644 --- a/drivers/metal/rendering_device_driver_metal.cpp +++ b/drivers/metal/rendering_device_driver_metal.cpp @@ -2848,6 +2848,7 @@ Error RenderingDeviceDriverMetal::_initialize(uint32_t p_device_index, uint32_t ERR_FAIL_COND_V(err, ERR_CANT_CREATE); device_properties = memnew(MetalDeviceProperties(device)); + pixel_formats = memnew(PixelFormats(device, device_properties->features)); device_profile = device_profile_from_properties(device_properties); resource_cache = std::make_unique(device, *pixel_formats, device_properties->limits.maxPerStageBufferCount); shader_container_format = memnew(RenderingShaderContainerFormatMetal(&device_profile)); @@ -2862,7 +2863,6 @@ Error RenderingDeviceDriverMetal::_initialize(uint32_t p_device_index, uint32_t // Set the pipeline cache ID based on the Metal version. pipeline_cache_id = "metal-driver-" + get_api_version(); - pixel_formats = memnew(PixelFormats(device, device_properties->features)); if (device_properties->features.layeredRendering) { multiview_capabilities.is_supported = true; multiview_capabilities.max_view_count = device_properties->limits.maxViewports;