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