reset command buffers on the thread they were spawned

updatetemplate
cosmonaut 2022-02-24 22:06:00 -08:00
parent 336468cc31
commit 5187093ddc
1 changed files with 11 additions and 13 deletions

View File

@ -8218,6 +8218,7 @@ static Refresh_CommandBuffer* VULKAN_AcquireCommandBuffer(
uint8_t fixed
) {
VulkanRenderer *renderer = (VulkanRenderer*) driverData;
VkResult result;
SDL_threadID threadID = SDL_ThreadID();
@ -8244,6 +8245,16 @@ static Refresh_CommandBuffer* VULKAN_AcquireCommandBuffer(
commandBuffer->renderPassInProgress = 0;
commandBuffer->renderPassColorTargetCount = 0;
result = renderer->vkResetCommandBuffer(
commandBuffer->commandBuffer,
VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT
);
if (result != VK_SUCCESS)
{
LogVulkanResultAsError("vkResetCommandBuffer", result);
}
VULKAN_INTERNAL_BeginCommandBuffer(renderer, commandBuffer);
return (Refresh_CommandBuffer*) commandBuffer;
@ -8418,21 +8429,8 @@ static void VULKAN_INTERNAL_CleanCommandBuffer(
) {
uint32_t i;
VulkanUniformBuffer *uniformBuffer;
VkResult result;
DescriptorSetData *descriptorSetData;
result = renderer->vkResetCommandBuffer(
commandBuffer->commandBuffer,
VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT
);
if (result != VK_SUCCESS)
{
LogVulkanResultAsError("vkResetCommandBuffer", result);
}
commandBuffer->submitted = 0;
/* Bound uniform buffers are now available */
for (i = 0; i < commandBuffer->boundUniformBufferCount; i += 1)