fix the UBO descriptor range to use UBO_SECTION_SIZE

pull/50/head
cosmonaut 2024-02-16 17:41:12 -08:00
parent a3d69ace21
commit 45f5bef337
1 changed files with 4 additions and 4 deletions

View File

@ -4244,7 +4244,7 @@ static VulkanUniformBufferObject* VULKAN_INTERNAL_CreateUniformBufferObject(
/* Update the descriptor set for the first and last time! */ /* Update the descriptor set for the first and last time! */
descriptorBufferInfo.buffer = uniformBufferObject->buffer->buffer; descriptorBufferInfo.buffer = uniformBufferObject->buffer->buffer;
descriptorBufferInfo.offset = 0; descriptorBufferInfo.offset = 0;
descriptorBufferInfo.range = VK_WHOLE_SIZE; descriptorBufferInfo.range = UBO_SECTION_SIZE;
writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeDescriptorSet.pNext = NULL; writeDescriptorSet.pNext = NULL;
@ -6846,7 +6846,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
SDL_LockMutex(renderer->vertexUniformBufferObject->lock); SDL_LockMutex(renderer->vertexUniformBufferObject->lock);
if (renderer->vertexUniformBufferObject->currentOffset + dataLengthInBytes >= UBO_BUFFER_SIZE) if (renderer->vertexUniformBufferObject->currentOffset + dataLengthInBytes + UBO_SECTION_SIZE >= UBO_BUFFER_SIZE)
{ {
renderer->vertexUniformBufferObject->currentOffset = 0; renderer->vertexUniformBufferObject->currentOffset = 0;
} }
@ -6885,7 +6885,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
SDL_LockMutex(renderer->fragmentUniformBufferObject->lock); SDL_LockMutex(renderer->fragmentUniformBufferObject->lock);
if (renderer->fragmentUniformBufferObject->currentOffset + dataLengthInBytes >= UBO_BUFFER_SIZE) if (renderer->fragmentUniformBufferObject->currentOffset + dataLengthInBytes + UBO_SECTION_SIZE >= UBO_BUFFER_SIZE)
{ {
renderer->fragmentUniformBufferObject->currentOffset = 0; renderer->fragmentUniformBufferObject->currentOffset = 0;
} }
@ -6924,7 +6924,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
SDL_LockMutex(renderer->computeUniformBufferObject->lock); SDL_LockMutex(renderer->computeUniformBufferObject->lock);
if (renderer->computeUniformBufferObject->currentOffset + dataLengthInBytes >= UBO_BUFFER_SIZE) if (renderer->computeUniformBufferObject->currentOffset + dataLengthInBytes + UBO_SECTION_SIZE >= UBO_BUFFER_SIZE)
{ {
renderer->computeUniformBufferObject->currentOffset = 0; renderer->computeUniformBufferObject->currentOffset = 0;
} }