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 <egdaniel@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com> (cherry picked from commit 79ff8f20bf26452fd5f0a1357861ebc103a86ab6) Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446179 Auto-Submit: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/mtl/GrMtlCommandBuffer.h b/src/gpu/mtl/GrMtlCommandBuffer.h index f18bd88..8b32974 100644 --- a/src/gpu/mtl/GrMtlCommandBuffer.h +++ b/src/gpu/mtl/GrMtlCommandBuffer.h
@@ -51,8 +51,9 @@ } void addResource(sk_sp<const GrManagedResource> 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<const GrBuffer> buffer) {
diff --git a/src/gpu/mtl/GrMtlCommandBuffer.mm b/src/gpu/mtl/GrMtlCommandBuffer.mm index 255f856..0f5a0f7 100644 --- a/src/gpu/mtl/GrMtlCommandBuffer.mm +++ b/src/gpu/mtl/GrMtlCommandBuffer.mm
@@ -22,7 +22,7 @@ sk_sp<GrMtlCommandBuffer> GrMtlCommandBuffer::Make(id<MTLCommandQueue> queue) { id<MTLCommandBuffer> mtlCommandBuffer; - mtlCommandBuffer = [queue commandBufferWithUnretainedReferences]; + mtlCommandBuffer = [queue commandBuffer]; if (nil == mtlCommandBuffer) { return nullptr; }