GenVertexBuffer and GenIndexBuffer

pull/8/head
cosmonaut 2020-12-18 17:32:27 -08:00
parent a153433cec
commit 61bdec0357
1 changed files with 28 additions and 2 deletions

View File

@ -2931,14 +2931,40 @@ static REFRESH_Buffer* VULKAN_GenVertexBuffer(
REFRESH_Renderer *driverData, REFRESH_Renderer *driverData,
uint32_t sizeInBytes uint32_t sizeInBytes
) { ) {
SDL_assert(0); VulkanBuffer *buffer = (VulkanBuffer*) SDL_malloc(sizeof(VulkanBuffer));
if(!VULKAN_INTERNAL_CreateBuffer(
(VulkanRenderer*) driverData,
sizeInBytes,
RESOURCE_ACCESS_VERTEX_BUFFER,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
buffer
)) {
REFRESH_LogError("Failed to create vertex buffer!");
return NULL;
}
return (REFRESH_Buffer*) buffer;
} }
static REFRESH_Buffer* VULKAN_GenIndexBuffer( static REFRESH_Buffer* VULKAN_GenIndexBuffer(
REFRESH_Renderer *driverData, REFRESH_Renderer *driverData,
uint32_t sizeInBytes uint32_t sizeInBytes
) { ) {
SDL_assert(0); VulkanBuffer *buffer = (VulkanBuffer*) SDL_malloc(sizeof(VulkanBuffer));
if (!VULKAN_INTERNAL_CreateBuffer(
(VulkanRenderer*) driverData,
sizeInBytes,
RESOURCE_ACCESS_INDEX_BUFFER,
VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
buffer
)) {
REFRESH_LogError("Failed to create index buffer!");
return NULL;
}
return (REFRESH_Buffer*) buffer;
} }
static REFRESH_Buffer* VULKAN_GenShaderParamBuffer( static REFRESH_Buffer* VULKAN_GenShaderParamBuffer(