mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-05 22:30:29 +00:00
Merge 90707c019c into fa2a726cc3
This commit is contained in:
commit
85ac6c297f
1 changed files with 31 additions and 0 deletions
|
|
@ -1357,6 +1357,27 @@ static inline const char *VkErrorMessages(VkResult code)
|
|||
|
||||
// Utility
|
||||
|
||||
static void VULKAN_INTERNAL_SetObjectNamePrintf(
|
||||
VulkanRenderer *renderer, void *object, VkObjectType objectType, const char *format, ...
|
||||
) {
|
||||
if (!renderer->debugMode)
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
char buf[1024] = { 0 };
|
||||
va_start(args, format);
|
||||
vsnprintf(buf, sizeof(buf), format, args);
|
||||
va_end(args);
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo = {
|
||||
.objectHandle = (uint64_t)object,
|
||||
.objectType = objectType,
|
||||
.pObjectName = buf,
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
|
||||
.pNext = NULL,
|
||||
};
|
||||
renderer->vkSetDebugUtilsObjectNameEXT(renderer->logicalDevice, &nameInfo);
|
||||
}
|
||||
|
||||
static inline VkPolygonMode SDLToVK_PolygonMode(
|
||||
VulkanRenderer *renderer,
|
||||
SDL_GPUFillMode mode)
|
||||
|
|
@ -9611,6 +9632,11 @@ static bool VULKAN_INTERNAL_AllocateCommandBuffer(
|
|||
|
||||
// Pool it!
|
||||
|
||||
VULKAN_INTERNAL_SetObjectNamePrintf(
|
||||
renderer, commandBuffer->commandBuffer, VK_OBJECT_TYPE_COMMAND_BUFFER,
|
||||
"[Thread %p's Command pool %p] Command buffer %p", vulkanCommandPool->threadID, vulkanCommandPool, commandBuffer
|
||||
);
|
||||
|
||||
vulkanCommandPool->inactiveCommandBuffers[vulkanCommandPool->inactiveCommandBufferCount] = commandBuffer;
|
||||
vulkanCommandPool->inactiveCommandBufferCount += 1;
|
||||
|
||||
|
|
@ -9655,6 +9681,11 @@ static VulkanCommandPool *VULKAN_INTERNAL_FetchCommandPool(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
VULKAN_INTERNAL_SetObjectNamePrintf(
|
||||
renderer, vulkanCommandPool->commandPool, VK_OBJECT_TYPE_COMMAND_POOL,
|
||||
"[Thread %p] Command pool %p", threadID, vulkanCommandPool
|
||||
);
|
||||
|
||||
vulkanCommandPool->threadID = threadID;
|
||||
|
||||
vulkanCommandPool->inactiveCommandBufferCapacity = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue