forked from MoonsideGames/Refresh
uniform API update
parent
4699c158f3
commit
7f3e89315e
|
@ -991,13 +991,13 @@ REFRESHAPI void Refresh_SetBufferData(
|
||||||
* Will use the block size of the currently bound vertex shader.
|
* Will use the block size of the currently bound vertex shader.
|
||||||
*
|
*
|
||||||
* data: The client data to write into the buffer.
|
* 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(
|
REFRESHAPI uint32_t Refresh_PushVertexShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t paramBlockCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Pushes fragment shader params to the device.
|
/* 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.
|
* Will use the block size of the currently bound fragment shader.
|
||||||
*
|
*
|
||||||
* data: The client data to write into the buffer.
|
* 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(
|
REFRESHAPI uint32_t Refresh_PushFragmentShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t paramBlockCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Pushes compute shader params to the device.
|
/* Pushes compute shader params to the device.
|
||||||
|
@ -1024,14 +1024,14 @@ REFRESHAPI uint32_t Refresh_PushFragmentShaderUniforms(
|
||||||
* A compute pipeline must be bound.
|
* A compute pipeline must be bound.
|
||||||
* Will use the block size of the currently bound compute shader.
|
* Will use the block size of the currently bound compute shader.
|
||||||
*
|
*
|
||||||
* data: The client data to write into the buffer.
|
* data: The client data to write into the buffer.
|
||||||
* paramBlockData: The number of param-sized blocks from the client buffer to write.
|
* dataLengthInBytes: The length of the data to write.
|
||||||
*/
|
*/
|
||||||
REFRESHAPI uint32_t Refresh_PushComputeShaderUniforms(
|
REFRESHAPI uint32_t Refresh_PushComputeShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t paramBlockCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Getters */
|
/* Getters */
|
||||||
|
|
|
@ -468,14 +468,14 @@ uint32_t Refresh_PushVertexShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
if (device == NULL) { return 0; }
|
if (device == NULL) { return 0; }
|
||||||
return device->PushVertexShaderUniforms(
|
return device->PushVertexShaderUniforms(
|
||||||
device->driverData,
|
device->driverData,
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
data,
|
data,
|
||||||
elementCount
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,14 +483,14 @@ uint32_t Refresh_PushFragmentShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
if (device == NULL) { return 0; }
|
if (device == NULL) { return 0; }
|
||||||
return device->PushFragmentShaderUniforms(
|
return device->PushFragmentShaderUniforms(
|
||||||
device->driverData,
|
device->driverData,
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
data,
|
data,
|
||||||
elementCount
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,14 +498,14 @@ uint32_t Refresh_PushComputeShaderUniforms(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
if (device == NULL) { return 0; }
|
if (device == NULL) { return 0; }
|
||||||
return device->PushComputeShaderUniforms(
|
return device->PushComputeShaderUniforms(
|
||||||
device->driverData,
|
device->driverData,
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
data,
|
data,
|
||||||
elementCount
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,21 +314,21 @@ struct Refresh_Device
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
uint32_t(*PushFragmentShaderUniforms)(
|
uint32_t(*PushFragmentShaderUniforms)(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
uint32_t (*PushComputeShaderUniforms)(
|
uint32_t (*PushComputeShaderUniforms)(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
void(*BindVertexSamplers)(
|
void(*BindVertexSamplers)(
|
||||||
|
|
|
@ -1544,7 +1544,7 @@ static inline uint32_t VULKAN_INTERNAL_BytesPerPixel(VkFormat format)
|
||||||
case VK_FORMAT_BC3_UNORM_BLOCK:
|
case VK_FORMAT_BC3_UNORM_BLOCK:
|
||||||
return 16;
|
return 16;
|
||||||
|
|
||||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||||
case VK_FORMAT_R8G8B8A8_SNORM:
|
case VK_FORMAT_R8G8B8A8_SNORM:
|
||||||
case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
|
case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
|
||||||
case VK_FORMAT_R16G16_UNORM:
|
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_R16G16B16A16_SFLOAT:
|
||||||
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
|
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
|
||||||
return 8;
|
return 8;
|
||||||
|
|
||||||
case VK_FORMAT_R8_UNORM:
|
case VK_FORMAT_R8_UNORM:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case VK_FORMAT_D16_UNORM_S8_UINT:
|
case VK_FORMAT_D16_UNORM_S8_UINT:
|
||||||
return 3;
|
return 3;
|
||||||
|
|
||||||
case VK_FORMAT_D32_SFLOAT_S8_UINT:
|
case VK_FORMAT_D32_SFLOAT_S8_UINT:
|
||||||
return 5;
|
return 5;
|
||||||
|
|
||||||
|
@ -6203,7 +6203,7 @@ static void VULKAN_SetTextureDataYUV(
|
||||||
SDL_LockMutex(renderer->stagingLock);
|
SDL_LockMutex(renderer->stagingLock);
|
||||||
|
|
||||||
VULKAN_INTERNAL_MaybeExpandStagingBuffer(
|
VULKAN_INTERNAL_MaybeExpandStagingBuffer(
|
||||||
renderer,
|
renderer,
|
||||||
yDataLength + uvDataLength
|
yDataLength + uvDataLength
|
||||||
);
|
);
|
||||||
VULKAN_INTERNAL_MaybeBeginTransferCommandBuffer(renderer);
|
VULKAN_INTERNAL_MaybeBeginTransferCommandBuffer(renderer);
|
||||||
|
@ -6555,7 +6555,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
||||||
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
||||||
|
@ -6579,7 +6579,7 @@ static uint32_t VULKAN_PushVertexShaderUniforms(
|
||||||
(Refresh_Buffer*) renderer->vertexUBO,
|
(Refresh_Buffer*) renderer->vertexUBO,
|
||||||
renderer->vertexUBOOffset,
|
renderer->vertexUBOOffset,
|
||||||
data,
|
data,
|
||||||
elementCount * vulkanCommandBuffer->currentGraphicsPipeline->vertexUBOBlockSize
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
SDL_UnlockMutex(renderer->uniformBufferLock);
|
SDL_UnlockMutex(renderer->uniformBufferLock);
|
||||||
|
@ -6591,7 +6591,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
||||||
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
||||||
|
@ -6615,7 +6615,7 @@ static uint32_t VULKAN_PushFragmentShaderUniforms(
|
||||||
(Refresh_Buffer*) renderer->fragmentUBO,
|
(Refresh_Buffer*) renderer->fragmentUBO,
|
||||||
renderer->fragmentUBOOffset,
|
renderer->fragmentUBOOffset,
|
||||||
data,
|
data,
|
||||||
elementCount * vulkanCommandBuffer->currentGraphicsPipeline->fragmentUBOBlockSize
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
SDL_UnlockMutex(renderer->uniformBufferLock);
|
SDL_UnlockMutex(renderer->uniformBufferLock);
|
||||||
|
@ -6627,7 +6627,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
|
||||||
Refresh_Renderer *driverData,
|
Refresh_Renderer *driverData,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
void *data,
|
void *data,
|
||||||
uint32_t elementCount
|
uint32_t dataLengthInBytes
|
||||||
) {
|
) {
|
||||||
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
||||||
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
||||||
|
@ -6651,7 +6651,7 @@ static uint32_t VULKAN_PushComputeShaderUniforms(
|
||||||
(Refresh_Buffer*) renderer->computeUBO,
|
(Refresh_Buffer*) renderer->computeUBO,
|
||||||
renderer->computeUBOOffset,
|
renderer->computeUBOOffset,
|
||||||
data,
|
data,
|
||||||
elementCount * vulkanCommandBuffer->currentComputePipeline->computeUBOBlockSize
|
dataLengthInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
SDL_UnlockMutex(renderer->uniformBufferLock);
|
SDL_UnlockMutex(renderer->uniformBufferLock);
|
||||||
|
|
Loading…
Reference in New Issue