diff --git a/src/modules/graphics/metal/Buffer.mm b/src/modules/graphics/metal/Buffer.mm index c797ffa6d..20394d0aa 100644 --- a/src/modules/graphics/metal/Buffer.mm +++ b/src/modules/graphics/metal/Buffer.mm @@ -76,6 +76,9 @@ static MTLPixelFormat getMTLPixelFormat(DataFormat format) if (buffer == nil) throw love::Exception("Could not create buffer with %d bytes (out of VRAM?)", size); + if (!debugName.empty()) + buffer.label = @(debugName.c_str()); + if (usageFlags & BUFFERUSAGEFLAG_TEXEL) { if (@available(iOS 12, macOS 10.14, *)) diff --git a/src/modules/graphics/metal/Texture.mm b/src/modules/graphics/metal/Texture.mm index 0efd7d21a..d9b07f67e 100644 --- a/src/modules/graphics/metal/Texture.mm +++ b/src/modules/graphics/metal/Texture.mm @@ -86,6 +86,9 @@ static MTLTextureType getMTLTextureType(TextureType type, int msaa) if (texture == nil) throw love::Exception("Out of graphics memory."); + if (!debugName.empty()) + texture.label = @(debugName.c_str()); + actualMSAASamples = gfx->getClosestMSAASamples(getRequestedMSAA()); if (actualMSAASamples > 1) @@ -100,6 +103,9 @@ static MTLTextureType getMTLTextureType(TextureType type, int msaa) texture = nil; throw love::Exception("Out of graphics memory."); } + + if (!debugName.empty()) + msaaTexture.label = [@(debugName.c_str()) stringByAppendingString:@" (MSAA buffer)"]; } int mipcount = getMipmapCount();