diff --git a/include/Refresh.h b/include/Refresh.h index 19fae50..9752fdd 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -825,15 +825,6 @@ REFRESHAPI REFRESH_Buffer* REFRESH_GenIndexBuffer( uint32_t sizeInBytes ); -/* Creates a shader param buffer to be used by shaders. - * - * sizeInBytes: The length of the shader param buffer. - */ -REFRESHAPI REFRESH_Buffer* REFRESH_GenShaderParamBuffer( - REFRESH_Device *device, - uint32_t sizeInBytes -); - /* Setters */ /* Uploads image data to a 2D texture object. @@ -970,16 +961,14 @@ REFRESHAPI void REFRESH_SetIndexBufferData( /* Pushes shader param data to a buffer. * - * shaderParamBuffer: The buffer to be updated. - * offsetInBytes: The starting offset of the buffer to write into. + * pipeline: The graphics pipeline to push shader data to. * data: The client data to write into the buffer. * elementCount: The number of elements from the client buffer to write. * elementSizeInBytes: The size of each element in the client buffer. */ -REFRESHAPI void REFRESH_SetShaderParamData( +REFRESHAPI void REFRESH_PushShaderParamData( REFRESH_Device *device, - REFRESH_Buffer *shaderParamBuffer, - uint32_t offsetInBytes, + REFRESH_GraphicsPipeline *pipeline, void *data, uint32_t elementCount, uint32_t elementSizeInBytes diff --git a/src/Refresh.c b/src/Refresh.c index 0b83b08..9fbcad0 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -388,17 +388,6 @@ REFRESH_Buffer* REFRESH_GenIndexBuffer( ); } -REFRESH_Buffer* REFRESH_GenShaderParamBuffer( - REFRESH_Device *device, - uint32_t sizeInBytes -) { - NULL_RETURN_NULL(device); - return device->GenShaderParamBuffer( - device->driverData, - sizeInBytes - ); -} - void REFRESH_SetTextureData2D( REFRESH_Device *device, REFRESH_Texture *texture, @@ -543,19 +532,17 @@ void REFRESH_SetIndexBufferData( ); } -void REFRESH_SetShaderParamData( +void REFRESH_PushShaderParamData( REFRESH_Device *device, - REFRESH_Buffer *shaderParamBuffer, - uint32_t offsetInBytes, + REFRESH_GraphicsPipeline *pipeline, void *data, uint32_t elementCount, uint32_t elementSizeInBytes ) { NULL_RETURN(device); - device->SetShaderParamData( + device->PushShaderParamData( device->driverData, - shaderParamBuffer, - offsetInBytes, + pipeline, data, elementCount, elementSizeInBytes diff --git a/src/Refresh_Driver.h b/src/Refresh_Driver.h index fedc104..dff87bb 100644 --- a/src/Refresh_Driver.h +++ b/src/Refresh_Driver.h @@ -284,11 +284,6 @@ struct REFRESH_Device uint32_t sizeInBytes ); - REFRESH_Buffer* (*GenShaderParamBuffer)( - REFRESH_Renderer *driverData, - uint32_t sizeInBytes - ); - /* Setters */ void(*SetTextureData2D)( @@ -360,10 +355,9 @@ struct REFRESH_Device uint32_t dataLength ); - void(*SetShaderParamData)( + void(*PushShaderParamData)( REFRESH_Renderer *driverData, - REFRESH_Buffer *shaderParamBuffer, - uint32_t offsetInBytes, + REFRESH_GraphicsPipeline *pipeline, void *data, uint32_t elementCount, uint32_t elementSizeInBytes @@ -519,14 +513,13 @@ struct REFRESH_Device ASSIGN_DRIVER_FUNC(GenDepthStencilTarget, name) \ ASSIGN_DRIVER_FUNC(GenVertexBuffer, name) \ ASSIGN_DRIVER_FUNC(GenIndexBuffer, name) \ - ASSIGN_DRIVER_FUNC(GenShaderParamBuffer, name) \ ASSIGN_DRIVER_FUNC(SetTextureData2D, name) \ ASSIGN_DRIVER_FUNC(SetTextureData3D, name) \ ASSIGN_DRIVER_FUNC(SetTextureDataCube, name) \ ASSIGN_DRIVER_FUNC(SetTextureDataYUV, name) \ ASSIGN_DRIVER_FUNC(SetVertexBufferData, name) \ ASSIGN_DRIVER_FUNC(SetIndexBufferData, name) \ - ASSIGN_DRIVER_FUNC(SetShaderParamData, name) \ + ASSIGN_DRIVER_FUNC(PushShaderParamData, name) \ ASSIGN_DRIVER_FUNC(SetVertexSamplers, name) \ ASSIGN_DRIVER_FUNC(SetFragmentSamplers, name) \ ASSIGN_DRIVER_FUNC(GetTextureData2D, name) \ diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 162feec..75f306b 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -3117,10 +3117,9 @@ static void VULKAN_SetIndexBufferData( SDL_assert(0); } -static void VULKAN_SetShaderParamData( +static void VULKAN_PushShaderParamData( REFRESH_Renderer *driverData, - REFRESH_Buffer *shaderParamBuffer, - uint32_t offsetInBytes, + REFRESH_GraphicsPipeline *pipeline, void *data, uint32_t elementCount, uint32_t elementSizeInBytes