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

Commit 8bde66b

Browse files
committed
Fix clang tidy error and crash
1 parent 864b9b0 commit 8bde66b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

impeller/renderer/backend/metal/context_mtl.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static bool DeviceSupportsComputeSubgroups(id<MTLDevice> device) {
228228
auto context = std::shared_ptr<ContextMTL>(new ContextMTL(
229229
device,
230230
MTLShaderLibraryFromFileData(device, shader_libraries_data, label),
231-
worker_task_runner, std::move(is_gpu_disabled_sync_switch)));
231+
std::move(worker_task_runner), std::move(is_gpu_disabled_sync_switch)));
232232
if (!context->IsValid()) {
233233
FML_LOG(ERROR) << "Could not create Metal context.";
234234
return nullptr;

impeller/renderer/backend/metal/formats_mtl.mm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@
6464

6565
auto des = [[MTLDepthStencilDescriptor alloc] init];
6666

67-
des.depthCompareFunction = ToMTLCompareFunction(depth->depth_compare);
68-
des.depthWriteEnabled = depth->depth_write_enabled;
67+
// These temporary variables are necessary for clang-tidy (Fuchsia LLVM
68+
// version 17.0.0git) to not crash.
69+
auto compare_function = ToMTLCompareFunction(depth->depth_compare);
70+
auto depth_write_enabled = depth->depth_write_enabled;
71+
72+
des.depthCompareFunction = compare_function;
73+
des.depthWriteEnabled = depth_write_enabled;
6974

7075
if (front.has_value()) {
7176
des.frontFaceStencil = ToMTLStencilDescriptor(front.value());

0 commit comments

Comments
 (0)