rotate uniform buffer if we run out of space
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

pull/1/head
cosmonaut 2022-01-12 14:39:29 -08:00
parent 1eb749ed10
commit 38ff5af448
1 changed files with 21 additions and 10 deletions

View File

@ -3381,7 +3381,6 @@ static void VULKAN_INTERNAL_CreateUniformBuffer(
writeDescriptorSet.pImageInfo = NULL; writeDescriptorSet.pImageInfo = NULL;
writeDescriptorSet.pTexelBufferView = NULL; writeDescriptorSet.pTexelBufferView = NULL;
/* FIXME: this needs a lock */
renderer->vkUpdateDescriptorSets( renderer->vkUpdateDescriptorSets(
renderer->logicalDevice, renderer->logicalDevice,
1, 1,
@ -6900,9 +6899,13 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
graphicsPipeline->vertexUniformBlockSize >= graphicsPipeline->vertexUniformBlockSize >=
UBO_BUFFER_SIZE UBO_BUFFER_SIZE
) { ) {
/* FIXME: rotate another UBO in */ /* We're out of space in this buffer, bind the old one and acquire a new one */
Refresh_LogError("Vertex UBO overflow!"); VULKAN_INTERNAL_BindUniformBuffer(vulkanCommandBuffer->vertexUniformBuffer);
return 0; vulkanCommandBuffer->vertexUniformBuffer = VULKAN_INTERNAL_AcquireUniformBufferFromPool(
renderer,
renderer->vertexUniformBufferPool,
graphicsPipeline->vertexUniformBlockSize
);
} }
offset = vulkanCommandBuffer->vertexUniformBuffer->offset; offset = vulkanCommandBuffer->vertexUniformBuffer->offset;
@ -6948,9 +6951,13 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
graphicsPipeline->fragmentUniformBlockSize >= graphicsPipeline->fragmentUniformBlockSize >=
UBO_BUFFER_SIZE UBO_BUFFER_SIZE
) { ) {
/* FIXME: rotate another UBO in */ /* We're out of space in this buffer, bind the old one and acquire a new one */
Refresh_LogError("Fragment UBO overflow!"); VULKAN_INTERNAL_BindUniformBuffer(vulkanCommandBuffer->fragmentUniformBuffer);
return 0; vulkanCommandBuffer->fragmentUniformBuffer = VULKAN_INTERNAL_AcquireUniformBufferFromPool(
renderer,
renderer->fragmentUniformBufferPool,
graphicsPipeline->fragmentUniformBlockSize
);
} }
offset = vulkanCommandBuffer->fragmentUniformBuffer->offset; offset = vulkanCommandBuffer->fragmentUniformBuffer->offset;
@ -6995,9 +7002,13 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
computePipeline->uniformBlockSize >= computePipeline->uniformBlockSize >=
UBO_BUFFER_SIZE UBO_BUFFER_SIZE
) { ) {
/* FIXME: rotate a new uniform buffer in */ /* We're out of space in this buffer, bind the old one and acquire a new one */
Refresh_LogError("Compute UBO overflow!"); VULKAN_INTERNAL_BindUniformBuffer(vulkanCommandBuffer->computeUniformBuffer);
return 0; vulkanCommandBuffer->computeUniformBuffer = VULKAN_INTERNAL_AcquireUniformBufferFromPool(
renderer,
renderer->computeUniformBufferPool,
computePipeline->uniformBlockSize
);
} }
offset = vulkanCommandBuffer->computeUniformBuffer->offset; offset = vulkanCommandBuffer->computeUniformBuffer->offset;