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

@ -1544,7 +1544,7 @@ static inline uint32_t VULKAN_INTERNAL_BytesPerPixel(VkFormat format)
case VK_FORMAT_BC3_UNORM_BLOCK:
return 16;
case VK_FORMAT_R8G8B8A8_UNORM:
case VK_FORMAT_R8G8B8A8_UNORM:
case VK_FORMAT_R8G8B8A8_SNORM:
case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
case VK_FORMAT_R16G16_UNORM:
@ -1566,13 +1566,13 @@ static inline uint32_t VULKAN_INTERNAL_BytesPerPixel(VkFormat format)
case VK_FORMAT_R16G16B16A16_SFLOAT:
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
return 8;
case VK_FORMAT_R8_UNORM:
return 1;
case VK_FORMAT_D16_UNORM_S8_UINT:
return 3;
case VK_FORMAT_D32_SFLOAT_S8_UINT:
return 5;
@ -6203,7 +6203,7 @@ static void VULKAN_SetTextureDataYUV(
SDL_LockMutex(renderer->stagingLock);
VULKAN_INTERNAL_MaybeExpandStagingBuffer(
renderer,
renderer,
yDataLength + uvDataLength
);
VULKAN_INTERNAL_MaybeBeginTransferCommandBuffer(renderer);
@ -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);