[Metal] Add one missing label

Bug: skia:13446
Change-Id: I8c16561c62ea0defa408387c8a9b3dd0774c784e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/565637
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/ganesh/mtl/GrMtlAttachment.h b/src/gpu/ganesh/mtl/GrMtlAttachment.h
index 8af03ec..95f850f 100644
--- a/src/gpu/ganesh/mtl/GrMtlAttachment.h
+++ b/src/gpu/ganesh/mtl/GrMtlAttachment.h
@@ -87,6 +87,8 @@
 
     GrMtlGpu* getMtlGpu() const;
 
+    void onSetLabel() override;
+
     id<MTLTexture> fTexture;
 };
 
diff --git a/src/gpu/ganesh/mtl/GrMtlAttachment.mm b/src/gpu/ganesh/mtl/GrMtlAttachment.mm
index 6e71eb4..86fd7c7 100644
--- a/src/gpu/ganesh/mtl/GrMtlAttachment.mm
+++ b/src/gpu/ganesh/mtl/GrMtlAttachment.mm
@@ -178,4 +178,11 @@
     return static_cast<GrMtlGpu*>(this->getGpu());
 }
 
+void GrMtlAttachment::onSetLabel() {
+    SkASSERT(fTexture);
+    if (!this->getLabel().empty()) {
+        NSString* labelStr = @(this->getLabel().c_str());
+        fTexture.label = [@"_Skia_" stringByAppendingString:labelStr];
+    }
+}
 GR_NORETAIN_END