From 45f5bef3372d22a734bad8c71835ace1dacae5c1 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 16 Feb 2024 17:41:12 -0800 Subject: [PATCH] fix the UBO descriptor range to use UBO_SECTION_SIZE --- src/Refresh_Driver_Vulkan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 00bcd2c..7b08f95 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -4244,7 +4244,7 @@ static VulkanUniformBufferObject* VULKAN_INTERNAL_CreateUniformBufferObject( /* Update the descriptor set for the first and last time! */ descriptorBufferInfo.buffer = uniformBufferObject->buffer->buffer; descriptorBufferInfo.offset = 0; - descriptorBufferInfo.range = VK_WHOLE_SIZE; + descriptorBufferInfo.range = UBO_SECTION_SIZE; writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeDescriptorSet.pNext = NULL; @@ -6846,7 +6846,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms( 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; } @@ -6885,7 +6885,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms( 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; } @@ -6924,7 +6924,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms( 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; }