remove SetDataOptions
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

pull/6/head
cosmonaut 2022-01-13 15:05:27 -08:00
parent 0c153607f5
commit 65d5a65e9d
4 changed files with 59 additions and 81 deletions

View File

@ -96,12 +96,6 @@ typedef enum Refresh_StoreOp
REFRESH_STOREOP_DONT_CARE
} Refresh_StoreOp;
typedef enum Refresh_SetDataOptions
{
REFRESH_SETDATAOPTIONS_IMMEDIATE,
REFRESH_SETDATAOPTIONS_DEFERRED
} Refresh_SetDataOptions;
typedef enum Refresh_ClearOptionsBits
{
REFRESH_CLEAROPTIONS_COLOR = 0x00000001,
@ -968,7 +962,6 @@ REFRESHAPI void Refresh_CopyTextureToBuffer(
* offsetInBytes: The starting offset of the buffer to write into.
* data: The client data to write into the buffer.
* dataLength: The length of data from the client buffer to write.
* setDataOption: Specifies how the buffer data will be copied.
*/
REFRESHAPI void Refresh_SetBufferData(
Refresh_Device *device,
@ -976,8 +969,7 @@ REFRESHAPI void Refresh_SetBufferData(
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength,
Refresh_SetDataOptions setDataOption
uint32_t dataLength
);
/* Pushes vertex shader params to the device.

View File

@ -457,8 +457,7 @@ void Refresh_SetBufferData(
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength,
Refresh_SetDataOptions setDataOption
uint32_t dataLength
) {
NULL_RETURN(device);
device->SetBufferData(
@ -467,8 +466,7 @@ void Refresh_SetBufferData(
buffer,
offsetInBytes,
data,
dataLength,
setDataOption
dataLength
);
}

View File

@ -310,8 +310,7 @@ struct Refresh_Device
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength,
Refresh_SetDataOptions setDataOption
uint32_t dataLength
);
uint32_t(*PushVertexShaderUniforms)(

View File

@ -6332,6 +6332,12 @@ static void VULKAN_SetTextureData(
VkBufferImageCopy imageCopy;
uint8_t *stagingBufferPointer;
if (vulkanCommandBuffer->renderPassInProgress)
{
Refresh_LogError("Cannot perform buffer updates mid-render pass!");
return;
}
VULKAN_INTERNAL_MaybeExpandTransferBuffer(
renderer,
vulkanCommandBuffer,
@ -6757,8 +6763,7 @@ static void VULKAN_SetBufferData(
Refresh_Buffer *buffer,
uint32_t offsetInBytes,
void* data,
uint32_t dataLength,
Refresh_SetDataOptions setDataOption
uint32_t dataLength
) {
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
VulkanCommandBuffer* vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
@ -6767,11 +6772,9 @@ static void VULKAN_SetBufferData(
uint8_t* transferBufferPointer;
VkBufferCopy bufferCopy;
if (setDataOption == REFRESH_SETDATAOPTIONS_DEFERRED)
{
if (vulkanCommandBuffer->renderPassInProgress)
{
Refresh_LogError("Cannot perform deferred buffer updates mid-render pass!");
Refresh_LogError("Cannot perform buffer updates mid-render pass!");
return;
}
@ -6820,20 +6823,6 @@ static void VULKAN_SetBufferData(
&bufferCopy
);
}
else if (setDataOption == REFRESH_SETDATAOPTIONS_IMMEDIATE)
{
VULKAN_INTERNAL_SetBufferData(
vulkanBuffer,
offsetInBytes,
data,
dataLength
);
}
else
{
Refresh_LogError("Unrecognized Refresh_SetDataOptions value!");
}
}
/* FIXME: this should return uint64_t */
static uint32_t VULKAN_PushVertexShaderUniforms(