Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Reland "[Impeller] Speculatively attempt to fix Metal PSO construction errors on host targets." #38301

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions impeller/renderer/backend/metal/pipeline_library_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// found in the LICENSE file.

#include "impeller/renderer/backend/metal/pipeline_library_mtl.h"

#include <Metal/Metal.h>

#include "flutter/fml/build_config.h"
#include "flutter/fml/container.h"
#include "impeller/base/promise.h"
#include "impeller/renderer/backend/metal/compute_pipeline_mtl.h"
Expand Down Expand Up @@ -131,9 +133,19 @@
));
promise->set_value(new_pipeline);
};
[device_ newRenderPipelineStateWithDescriptor:GetMTLRenderPipelineDescriptor(
descriptor)
auto mtl_descriptor = GetMTLRenderPipelineDescriptor(descriptor);
#if FML_OS_IOS
[device_ newRenderPipelineStateWithDescriptor:mtl_descriptor
completionHandler:completion_handler];
#else // FML_OS_IOS
// TODO(116919): Investigate and revert speculative fix to make MTL pipeline
// state creation use a worker.
NSError* error = nil;
auto render_pipeline_state =
[device_ newRenderPipelineStateWithDescriptor:mtl_descriptor
error:&error];
completion_handler(render_pipeline_state, error);
#endif // FML_OS_IOS
return pipeline_future;
}

Expand Down