splitting up push shader params by stages

submit_rewrite
cosmonaut 2020-12-20 01:33:32 -08:00
parent 4233c7767e
commit 778a8d89bd
4 changed files with 58 additions and 7 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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) \

View File

@ -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,