uniform API update

submit_rewrite
cosmonaut 2021-02-02 16:37:01 -08:00
parent 4699c158f3
commit 7f3e89315e
4 changed files with 26 additions and 26 deletions

View File

@ -991,13 +991,13 @@ REFRESHAPI void Refresh_SetBufferData(
* Will use the block size of the currently bound vertex shader.
*
* data: The client data to write into the buffer.
* paramBlockCount: The number of param-sized blocks from the client buffer to write.
* dataLengthInBytes: The length of the data to write.
*/
REFRESHAPI uint32_t Refresh_PushVertexShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t paramBlockCount
uint32_t dataLengthInBytes
);
/* Pushes fragment shader params to the device.
@ -1008,13 +1008,13 @@ REFRESHAPI uint32_t Refresh_PushVertexShaderUniforms(
* Will use the block size of the currently bound fragment shader.
*
* data: The client data to write into the buffer.
* paramBlockCount: The number of param-sized blocks from the client buffer to write.
* dataLengthInBytes: The length of the data to write.
*/
REFRESHAPI uint32_t Refresh_PushFragmentShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t paramBlockCount
uint32_t dataLengthInBytes
);
/* Pushes compute shader params to the device.
@ -1024,14 +1024,14 @@ REFRESHAPI uint32_t Refresh_PushFragmentShaderUniforms(
* A compute pipeline must be bound.
* Will use the block size of the currently bound compute shader.
*
* data: The client data to write into the buffer.
* paramBlockData: The number of param-sized blocks from the client buffer to write.
* data: The client data to write into the buffer.
* dataLengthInBytes: The length of the data to write.
*/
REFRESHAPI uint32_t Refresh_PushComputeShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t paramBlockCount
uint32_t dataLengthInBytes
);
/* Getters */

View File

@ -468,14 +468,14 @@ uint32_t Refresh_PushVertexShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushVertexShaderUniforms(
device->driverData,
commandBuffer,
data,
elementCount
dataLengthInBytes
);
}
@ -483,14 +483,14 @@ uint32_t Refresh_PushFragmentShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushFragmentShaderUniforms(
device->driverData,
commandBuffer,
data,
elementCount
dataLengthInBytes
);
}
@ -498,14 +498,14 @@ uint32_t Refresh_PushComputeShaderUniforms(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
if (device == NULL) { return 0; }
return device->PushComputeShaderUniforms(
device->driverData,
commandBuffer,
data,
elementCount
dataLengthInBytes
);
}

View File

@ -314,21 +314,21 @@ struct Refresh_Device
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
);
uint32_t(*PushFragmentShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
);
uint32_t (*PushComputeShaderUniforms)(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
);
void(*BindVertexSamplers)(

View File

@ -6555,7 +6555,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
@ -6579,7 +6579,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
(Refresh_Buffer*) renderer->vertexUBO,
renderer->vertexUBOOffset,
data,
elementCount * vulkanCommandBuffer->currentGraphicsPipeline->vertexUBOBlockSize
dataLengthInBytes
);
SDL_UnlockMutex(renderer->uniformBufferLock);
@ -6591,7 +6591,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
@ -6615,7 +6615,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
(Refresh_Buffer*) renderer->fragmentUBO,
renderer->fragmentUBOOffset,
data,
elementCount * vulkanCommandBuffer->currentGraphicsPipeline->fragmentUBOBlockSize
dataLengthInBytes
);
SDL_UnlockMutex(renderer->uniformBufferLock);
@ -6627,7 +6627,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer,
void *data,
uint32_t elementCount
uint32_t dataLengthInBytes
) {
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
@ -6651,7 +6651,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
(Refresh_Buffer*) renderer->computeUBO,
renderer->computeUBOOffset,
data,
elementCount * vulkanCommandBuffer->currentComputePipeline->computeUBOBlockSize
dataLengthInBytes
);
SDL_UnlockMutex(renderer->uniformBufferLock);