decouple buffer size from memory size
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e9e9e37d15
commit
a39b49ee9b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue