mirror of https://github.com/libsdl-org/SDL.git
Merge 90707c019c into 038a3806eb
This commit is contained in:
commit
33f9bd24b7
|
|
@ -1274,6 +1274,27 @@ static inline const char *VkErrorMessages(VkResult code)
|
||||||
|
|
||||||
// Utility
|
// 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(
|
static inline VkPolygonMode SDLToVK_PolygonMode(
|
||||||
VulkanRenderer *renderer,
|
VulkanRenderer *renderer,
|
||||||
SDL_GPUFillMode mode)
|
SDL_GPUFillMode mode)
|
||||||
|
|
@ -9397,6 +9418,11 @@ static bool VULKAN_INTERNAL_AllocateCommandBuffer(
|
||||||
|
|
||||||
// Pool it!
|
// 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->inactiveCommandBuffers[vulkanCommandPool->inactiveCommandBufferCount] = commandBuffer;
|
||||||
vulkanCommandPool->inactiveCommandBufferCount += 1;
|
vulkanCommandPool->inactiveCommandBufferCount += 1;
|
||||||
|
|
||||||
|
|
@ -9441,6 +9467,11 @@ static VulkanCommandPool *VULKAN_INTERNAL_FetchCommandPool(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VULKAN_INTERNAL_SetObjectNamePrintf(
|
||||||
|
renderer, vulkanCommandPool->commandPool, VK_OBJECT_TYPE_COMMAND_POOL,
|
||||||
|
"[Thread %p] Command pool %p", threadID, vulkanCommandPool
|
||||||
|
);
|
||||||
|
|
||||||
vulkanCommandPool->threadID = threadID;
|
vulkanCommandPool->threadID = threadID;
|
||||||
|
|
||||||
vulkanCommandPool->inactiveCommandBufferCapacity = 0;
|
vulkanCommandPool->inactiveCommandBufferCapacity = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue