diff --git a/include/Refresh.h b/include/Refresh.h index 2f08df5..791b818 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -970,14 +970,29 @@ REFRESHAPI void REFRESH_SetIndexBufferData( uint32_t dataLength ); -/* Pushes shader param data to a buffer. +/* Pushes vertex shader params for subsequent draw calls. * * 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_PushShaderParamData( +REFRESHAPI void REFRESH_PushVertexShaderParams( + REFRESH_Device *device, + REFRESH_GraphicsPipeline *pipeline, + void *data, + uint32_t elementCount, + uint32_t elementSizeInBytes +); + +/* Pushes fragment shader params for subsequent draw calls. + * + * 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_PushFragmentShaderParams( REFRESH_Device *device, REFRESH_GraphicsPipeline *pipeline, void *data, diff --git a/src/Refresh.c b/src/Refresh.c index 77736b8..3ac253b 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -538,7 +538,7 @@ void REFRESH_SetIndexBufferData( ); } -void REFRESH_PushShaderParamData( +void REFRESH_PushVertexShaderParams( REFRESH_Device *device, REFRESH_GraphicsPipeline *pipeline, void *data, @@ -546,7 +546,24 @@ void REFRESH_PushShaderParamData( uint32_t elementSizeInBytes ) { NULL_RETURN(device); - device->PushShaderParamData( + device->PushVertexShaderParams( + device->driverData, + pipeline, + data, + elementCount, + elementSizeInBytes + ); +} + +void REFRESH_PushFragmentShaderParams( + REFRESH_Device *device, + REFRESH_GraphicsPipeline *pipeline, + void *data, + uint32_t elementCount, + uint32_t elementSizeInBytes +) { + NULL_RETURN(device); + device->PushFragmentShaderParams( device->driverData, pipeline, data, diff --git a/src/Refresh_Driver.h b/src/Refresh_Driver.h index 8cd310b..83530e2 100644 --- a/src/Refresh_Driver.h +++ b/src/Refresh_Driver.h @@ -360,7 +360,15 @@ struct REFRESH_Device uint32_t dataLength ); - void(*PushShaderParamData)( + void(*PushVertexShaderParams)( + REFRESH_Renderer *driverData, + REFRESH_GraphicsPipeline *pipeline, + void *data, + uint32_t elementCount, + uint32_t elementSizeInBytes + ); + + void(*PushFragmentShaderParams)( REFRESH_Renderer *driverData, REFRESH_GraphicsPipeline *pipeline, void *data, @@ -533,7 +541,8 @@ struct REFRESH_Device ASSIGN_DRIVER_FUNC(SetTextureDataYUV, name) \ ASSIGN_DRIVER_FUNC(SetVertexBufferData, name) \ ASSIGN_DRIVER_FUNC(SetIndexBufferData, name) \ - ASSIGN_DRIVER_FUNC(PushShaderParamData, name) \ + ASSIGN_DRIVER_FUNC(PushVertexShaderParams, name) \ + ASSIGN_DRIVER_FUNC(PushFragmentShaderParams, 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 be4183d..504f44c 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -3703,7 +3703,17 @@ static void VULKAN_SetIndexBufferData( SDL_assert(0); } -static void VULKAN_PushShaderParamData( +static void VULKAN_PushVertexShaderParams( + REFRESH_Renderer *driverData, + REFRESH_GraphicsPipeline *pipeline, + void *data, + uint32_t elementCount, + uint32_t elementSizeInBytes +) { + SDL_assert(0); +} + +static void VULKAN_PushFragmentShaderParams( REFRESH_Renderer *driverData, REFRESH_GraphicsPipeline *pipeline, void *data,