diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index a9a43ccdef..67e989320e 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -377,19 +377,19 @@ static void vulkan_debug_mark_object(VkDevice device, void vulkan_debug_mark_buffer(VkDevice device, VkBuffer buffer) { static unsigned object_count; - vulkan_debug_mark_object(device, VK_OBJECT_TYPE_BUFFER, (uint64_t)buffer, "marked buffer", ++object_count); + vulkan_debug_mark_object(device, VK_OBJECT_TYPE_BUFFER, (uint64_t)buffer, "RetroArch buffer", ++object_count); } void vulkan_debug_mark_image(VkDevice device, VkImage image) { static unsigned object_count; - vulkan_debug_mark_object(device, VK_OBJECT_TYPE_IMAGE, (uint64_t)image, "marked image", ++object_count); + vulkan_debug_mark_object(device, VK_OBJECT_TYPE_IMAGE, (uint64_t)image, "RetroArch image", ++object_count); } void vulkan_debug_mark_memory(VkDevice device, VkDeviceMemory memory) { static unsigned object_count; - vulkan_debug_mark_object(device, VK_OBJECT_TYPE_DEVICE_MEMORY, (uint64_t)memory, "marked memory", ++object_count); + vulkan_debug_mark_object(device, VK_OBJECT_TYPE_DEVICE_MEMORY, (uint64_t)memory, "RetroArch memory", ++object_count); } struct vk_texture vulkan_create_texture(vk_t *vk, @@ -493,6 +493,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, if (type != VULKAN_TEXTURE_STAGING && type != VULKAN_TEXTURE_READBACK) { vkCreateImage(device, &info, NULL, &tex.image); + vulkan_debug_mark_image(device, tex.image); #if 0 vulkan_track_alloc(tex.image); #endif @@ -503,6 +504,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, /* Linear staging textures are not guaranteed to be supported, * use buffers instead. */ vkCreateBuffer(device, &buffer_info, NULL, &tex.buffer); + vulkan_debug_mark_buffer(device, tex.buffer); vkGetBufferMemoryRequirements(device, tex.buffer, &mem_reqs); } alloc.allocationSize = mem_reqs.size; @@ -548,6 +550,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, buffer_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; vkCreateBuffer(device, &buffer_info, NULL, &tex.buffer); + vulkan_debug_mark_buffer(device, tex.buffer); vkGetBufferMemoryRequirements(device, tex.buffer, &mem_reqs); alloc.allocationSize = mem_reqs.size; @@ -596,6 +599,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, else { vkAllocateMemory(device, &alloc, NULL, &tex.memory); + vulkan_debug_mark_memory(device, tex.memory); tex.memory_size = alloc.allocationSize; tex.memory_type = alloc.memoryTypeIndex; } @@ -1173,6 +1177,7 @@ struct vk_buffer vulkan_create_buffer( info.queueFamilyIndexCount = 0; info.pQueueFamilyIndices = NULL; vkCreateBuffer(context->device, &info, NULL, &buffer.buffer); + vulkan_debug_mark_buffer(context->device, buffer.buffer); vkGetBufferMemoryRequirements(context->device, buffer.buffer, &mem_reqs); @@ -1185,6 +1190,7 @@ struct vk_buffer vulkan_create_buffer( VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); vkAllocateMemory(context->device, &alloc, NULL, &buffer.memory); + vulkan_debug_mark_memory(context->device, buffer.memory); vkBindBufferMemory(context->device, buffer.buffer, buffer.memory, 0); buffer.size = size; diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 08a4f387db..98c57f6b92 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -2816,6 +2816,7 @@ static bool vulkan_frame(void *data, const void *frame, image_info.initialLayout = VK_IMAGE_LAYOUT_GENERAL; /* VK_IMAGE_LAYOUT_UNDEFINED; */ vkCreateImage(vk->context->device, &image_info, NULL, &vk->main_buffer.image); + vulkan_debug_mark_image(vk->context->device, vk->main_buffer.image); vkGetImageMemoryRequirements(vk->context->device, vk->main_buffer.image, &mem_reqs); alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; alloc.pNext = NULL; @@ -2826,6 +2827,7 @@ static bool vulkan_frame(void *data, const void *frame, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); vkAllocateMemory(vk->context->device, &alloc, NULL, &vk->main_buffer.memory); + vulkan_debug_mark_memory(vk->context->device, vk->main_buffer.memory); vkBindImageMemory(vk->context->device, vk->main_buffer.image, vk->main_buffer.memory, 0); diff --git a/gfx/drivers_shader/shader_vulkan.cpp b/gfx/drivers_shader/shader_vulkan.cpp index 409a42f4f9..726030ebc2 100644 --- a/gfx/drivers_shader/shader_vulkan.cpp +++ b/gfx/drivers_shader/shader_vulkan.cpp @@ -845,6 +845,7 @@ static std::unique_ptr vulkan_filter_chain_load_lut( image_info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; vkCreateImage(info->device, &image_info, nullptr, &tex); + vulkan_debug_mark_image(info->device, tex); vkGetImageMemoryRequirements(info->device, tex, &mem_reqs); alloc.allocationSize = mem_reqs.size; @@ -856,6 +857,7 @@ static std::unique_ptr vulkan_filter_chain_load_lut( if (vkAllocateMemory(info->device, &alloc, nullptr, &memory) != VK_SUCCESS) goto error; + vulkan_debug_mark_memory(info->device, memory); vkBindImageMemory(info->device, tex, memory, 0); view_info.image = tex; @@ -1703,6 +1705,7 @@ Buffer::Buffer(VkDevice device, | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); vkAllocateMemory(device, &alloc, NULL, &memory); + vulkan_debug_mark_memory(device, memory); vkBindBufferMemory(device, buffer, memory, 0); } @@ -2706,6 +2709,7 @@ void Framebuffer::init(DeferredDisposer *disposer) levels = info.mipLevels; vkCreateImage(device, &info, nullptr, &image); + vulkan_debug_mark_image(device, image); vkGetImageMemoryRequirements(device, image, &mem_reqs); @@ -2731,6 +2735,7 @@ void Framebuffer::init(DeferredDisposer *disposer) memory.size = mem_reqs.size; vkAllocateMemory(device, &alloc, nullptr, &memory.memory); + vulkan_debug_mark_memory(device, memory.memory); } vkBindImageMemory(device, image, memory.memory, 0);