From 79ff8f20bf26452fd5f0a1357861ebc103a86ab6 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Thu, 2 Sep 2021 09:17:26 -0400 Subject: [PATCH] Metal: re-enable retained references. A client of Flutter is seeing a crash when trying to release the MTLTexture in GrMtlAttachment. The range of CLs involved includes the one that disables retained references in the command buffer, so this is a speculative change to see if that is the culprit. Change-Id: Idd6e6b264086d671be52f456ef56f1fc5bafade8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444498 Reviewed-by: Greg Daniel Commit-Queue: Jim Van Verth --- src/gpu/mtl/GrMtlCommandBuffer.h | 5 +++-- src/gpu/mtl/GrMtlCommandBuffer.mm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gpu/mtl/GrMtlCommandBuffer.h b/src/gpu/mtl/GrMtlCommandBuffer.h index f18bd8853f..8b329745b2 100644 --- a/src/gpu/mtl/GrMtlCommandBuffer.h +++ b/src/gpu/mtl/GrMtlCommandBuffer.h @@ -51,8 +51,9 @@ public: } void addResource(sk_sp resource) { - SkASSERT(resource); - fTrackedResources.push_back(std::move(resource)); +// Disable generic resource tracking for now +// SkASSERT(resource); +// fTrackedResources.push_back(std::move(resource)); } void addGrBuffer(sk_sp buffer) { diff --git a/src/gpu/mtl/GrMtlCommandBuffer.mm b/src/gpu/mtl/GrMtlCommandBuffer.mm index 019ff77c97..745726375d 100644 --- a/src/gpu/mtl/GrMtlCommandBuffer.mm +++ b/src/gpu/mtl/GrMtlCommandBuffer.mm @@ -22,7 +22,7 @@ GR_NORETAIN_BEGIN sk_sp GrMtlCommandBuffer::Make(id queue) { id mtlCommandBuffer; - mtlCommandBuffer = [queue commandBufferWithUnretainedReferences]; + mtlCommandBuffer = [queue commandBuffer]; if (nil == mtlCommandBuffer) { return nullptr; }