decouple buffer size from memory size
continuous-integration/drone/push Build is passing Details

pull/14/head
cosmonaut 2022-02-24 13:45:02 -08:00
parent e9e9e37d15
commit a39b49ee9b
1 changed files with 5 additions and 4 deletions

View File

@ -667,6 +667,7 @@ typedef struct VulkanBuffer /* cast from Refresh_Buffer */
VkBuffer buffer;
VkDeviceSize size;
VkDeviceSize offset; /* move this to UsedMemoryRegion system */
VkDeviceSize memorySize; /* move this to UsedMemoryRegion system */
VulkanMemoryAllocation *allocation; /* see above */
VulkanResourceAccessType resourceAccessType;
VkBufferUsageFlags usage;
@ -2613,7 +2614,7 @@ static void VULKAN_INTERNAL_DestroyBuffer(
VULKAN_INTERNAL_NewMemoryFreeRegion(
buffer->allocation,
buffer->offset,
buffer->size
buffer->memorySize
);
SDL_UnlockMutex(renderer->allocatorLock);
@ -3184,7 +3185,7 @@ static VulkanBuffer* VULKAN_INTERNAL_CreateBuffer(
buffer->buffer,
&buffer->allocation,
&buffer->offset,
&buffer->size
&buffer->memorySize
);
/* We're out of available memory */
@ -6080,13 +6081,13 @@ static Refresh_Buffer* VULKAN_CreateBuffer(
buffer = VULKAN_INTERNAL_CreateBuffer(
(VulkanRenderer*)driverData,
sizeInBytes,
RESOURCE_ACCESS_VERTEX_BUFFER,
RESOURCE_ACCESS_MEMORY_TRANSFER_READ_WRITE,
vulkanUsageFlags
);
if (buffer == NULL)
{
Refresh_LogError("Failed to create vertex buffer!");
Refresh_LogError("Failed to create buffer!");
return NULL;
}