Browse Source

metal: add debug labels for internal buffers.

Sasha Szpakowski 1 year ago
parent
commit
75fd2fa06e

+ 1 - 0
src/modules/graphics/metal/Graphics.mm

@@ -341,6 +341,7 @@ Graphics::Graphics()
 		};
 		};
 
 
 		Buffer::Settings attribsettings(BUFFERUSAGEFLAG_VERTEX, BUFFERDATAUSAGE_STATIC);
 		Buffer::Settings attribsettings(BUFFERUSAGEFLAG_VERTEX, BUFFERDATAUSAGE_STATIC);
+		attribsettings.debugName = "Default Vertex Attributes";
 
 
 		defaultAttributesBuffer = newBuffer(attribsettings, dataformat, &defaults, sizeof(DefaultVertexAttributes), 0);
 		defaultAttributesBuffer = newBuffer(attribsettings, dataformat, &defaults, sizeof(DefaultVertexAttributes), 0);
 	}
 	}

+ 2 - 0
src/modules/graphics/metal/StreamBuffer.mm

@@ -48,6 +48,8 @@ public:
 		if (buffer == nil)
 		if (buffer == nil)
 			throw love::Exception("Out of graphics memory.");
 			throw love::Exception("Out of graphics memory.");
 
 
+		buffer.label = [NSString stringWithFormat:@"StreamBuffer (usage: %d, size: %ld)", usage, size];
+
 		data = (uint8 *) buffer.contents;
 		data = (uint8 *) buffer.contents;
 
 
 		for (int i = 0; i < BUFFER_FRAMES; i++)
 		for (int i = 0; i < BUFFER_FRAMES; i++)