rename CpuBuffer to TransferBuffer
continuous-integration/drone/push Build is failing Details

abi_break
cosmonaut 2024-02-23 09:42:31 -08:00
parent 2798067d54
commit 2f57a05c85
3 changed files with 51 additions and 51 deletions

View File

@ -70,7 +70,7 @@ REFRESHAPI uint32_t Refresh_LinkedVersion(void);
typedef struct Refresh_Device Refresh_Device; typedef struct Refresh_Device Refresh_Device;
typedef struct Refresh_GpuBuffer Refresh_GpuBuffer; typedef struct Refresh_GpuBuffer Refresh_GpuBuffer;
typedef struct Refresh_CpuBuffer Refresh_CpuBuffer; typedef struct Refresh_TransferBuffer Refresh_TransferBuffer;
typedef struct Refresh_Texture Refresh_Texture; typedef struct Refresh_Texture Refresh_Texture;
typedef struct Refresh_Sampler Refresh_Sampler; typedef struct Refresh_Sampler Refresh_Sampler;
typedef struct Refresh_ShaderModule Refresh_ShaderModule; typedef struct Refresh_ShaderModule Refresh_ShaderModule;
@ -688,11 +688,11 @@ REFRESHAPI Refresh_GpuBuffer* Refresh_CreateGpuBuffer(
uint32_t sizeInBytes uint32_t sizeInBytes
); );
/* Creates a CpuBuffer. /* Creates a TransferBuffer.
* *
* sizeInBytes: The length of the buffer. * sizeInBytes: The length of the buffer.
*/ */
REFRESHAPI Refresh_CpuBuffer* Refresh_CreateCpuBuffer( REFRESHAPI Refresh_TransferBuffer* Refresh_CreateTransferBuffer(
Refresh_Device *device, Refresh_Device *device,
uint32_t sizeInBytes uint32_t sizeInBytes
); );
@ -736,11 +736,11 @@ REFRESHAPI void Refresh_QueueDestroyGpuBuffer(
/* Sends a buffer to be destroyed by the renderer. Note that we call it /* Sends a buffer to be destroyed by the renderer. Note that we call it
* "QueueDestroy" because it may not be immediately destroyed by the renderer. * "QueueDestroy" because it may not be immediately destroyed by the renderer.
* *
* buffer: The Refresh_CpuBuffer to be destroyed. * buffer: The Refresh_TransferBuffer to be destroyed.
*/ */
REFRESHAPI void Refresh_QueueDestroyCpuBuffer( REFRESHAPI void Refresh_QueueDestroyTransferBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CpuBuffer *buffer Refresh_TransferBuffer *buffer
); );
/* Sends a shader module to be destroyed by the renderer. Note that we call it /* Sends a shader module to be destroyed by the renderer. Note that we call it
@ -1049,16 +1049,16 @@ REFRESHAPI void Refresh_EndComputePass(
Refresh_CommandBuffer *commandBuffer Refresh_CommandBuffer *commandBuffer
); );
/* CpuBuffer Set/Get */ /* TransferBuffer Set/Get */
/* Immediately copies data from a pointer into a CpuBuffer. /* Immediately copies data from a pointer into a TransferBuffer.
* *
* option: * option:
* SAFEDISCARD: * SAFEDISCARD:
* If this CpuBuffer has been used in a copy command that has not completed, * If this TransferBuffer has been used in a copy command that has not completed,
* the issued copy commands will still be valid at the cost of increased memory usage. * the issued copy commands will still be valid at the cost of increased memory usage.
* Otherwise the data will overwrite. * Otherwise the data will overwrite.
* It is not recommended to use this option with large CpuBuffers. * It is not recommended to use this option with large TransferBuffers.
* *
* OVERWRITE: * OVERWRITE:
* Overwrites the data regardless of whether a copy has been issued. * Overwrites the data regardless of whether a copy has been issued.
@ -1067,15 +1067,15 @@ REFRESHAPI void Refresh_EndComputePass(
REFRESHAPI void Refresh_SetData( REFRESHAPI void Refresh_SetData(
Refresh_Device *device, Refresh_Device *device,
void* data, void* data,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams, Refresh_BufferCopy *copyParams,
Refresh_SetDataOptions option Refresh_SetDataOptions option
); );
/* Immediately copies data from a CpuBuffer into a pointer. */ /* Immediately copies data from a TransferBuffer into a pointer. */
REFRESHAPI void Refresh_GetData( REFRESHAPI void Refresh_GetData(
Refresh_Device *device, Refresh_Device *device,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
void* data, void* data,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );
@ -1093,36 +1093,36 @@ REFRESHAPI void Refresh_BeginCopyPass(
* You MAY assume that the copy has finished for subsequent commands. * You MAY assume that the copy has finished for subsequent commands.
*/ */
/* Uploads data from a CpuBuffer to a texture. */ /* Uploads data from a TransferBuffer to a texture. */
REFRESHAPI void Refresh_UploadToTexture( REFRESHAPI void Refresh_UploadToTexture(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
); );
/* Uploads data from a CpuBuffer to a GpuBuffer. */ /* Uploads data from a TransferBuffer to a GpuBuffer. */
REFRESHAPI void Refresh_UploadToBuffer( REFRESHAPI void Refresh_UploadToBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );
/* GPU-to-CPU copies occur on the GPU timeline. /* GPU-to-CPU copies occur on the GPU timeline.
* *
* You may NOT assume that the data in the CpuBuffer is fully copied * You may NOT assume that the data in the TransferBuffer is fully copied
* until the command buffer has finished execution. * until the command buffer has finished execution.
*/ */
/* Downloads data from a texture to a CpuBuffer. */ /* Downloads data from a texture to a TransferBuffer. */
REFRESHAPI void Refresh_DownloadFromTexture( REFRESHAPI void Refresh_DownloadFromTexture(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
); );
@ -1131,7 +1131,7 @@ REFRESHAPI void Refresh_DownloadFromBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );

View File

@ -308,12 +308,12 @@ Refresh_GpuBuffer* Refresh_CreateGpuBuffer(
); );
} }
Refresh_CpuBuffer* Refresh_CreateCpuBuffer( Refresh_TransferBuffer* Refresh_CreateTransferBuffer(
Refresh_Device *device, Refresh_Device *device,
uint32_t sizeInBytes uint32_t sizeInBytes
) { ) {
NULL_RETURN_NULL(device); NULL_RETURN_NULL(device);
return device->CreateCpuBuffer( return device->CreateTransferBuffer(
device->driverData, device->driverData,
sizeInBytes sizeInBytes
); );
@ -354,12 +354,12 @@ void Refresh_QueueDestroyGpuBuffer(
); );
} }
void Refresh_QueueDestroyCpuBuffer( void Refresh_QueueDestroyTransferBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CpuBuffer *buffer Refresh_TransferBuffer *buffer
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
device->QueueDestroyCpuBuffer( device->QueueDestroyTransferBuffer(
device->driverData, device->driverData,
buffer buffer
); );
@ -730,12 +730,12 @@ void Refresh_EndComputePass(
); );
} }
/* CpuBuffer Set/Get */ /* TransferBuffer Set/Get */
void Refresh_SetData( void Refresh_SetData(
Refresh_Device *device, Refresh_Device *device,
void* data, void* data,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams, Refresh_BufferCopy *copyParams,
Refresh_SetDataOptions option Refresh_SetDataOptions option
) { ) {
@ -743,7 +743,7 @@ void Refresh_SetData(
device->SetData( device->SetData(
device->driverData, device->driverData,
data, data,
cpuBuffer, transferBuffer,
copyParams, copyParams,
option option
); );
@ -751,14 +751,14 @@ void Refresh_SetData(
void Refresh_GetData( void Refresh_GetData(
Refresh_Device *device, Refresh_Device *device,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
void* data, void* data,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
device->GetData( device->GetData(
device->driverData, device->driverData,
cpuBuffer, transferBuffer,
data, data,
copyParams copyParams
); );
@ -780,7 +780,7 @@ void Refresh_BeginCopyPass(
void Refresh_UploadToTexture( void Refresh_UploadToTexture(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
) { ) {
@ -788,7 +788,7 @@ void Refresh_UploadToTexture(
device->UploadToTexture( device->UploadToTexture(
device->driverData, device->driverData,
commandBuffer, commandBuffer,
cpuBuffer, transferBuffer,
textureSlice, textureSlice,
copyParams copyParams
); );
@ -797,7 +797,7 @@ void Refresh_UploadToTexture(
void Refresh_UploadToBuffer( void Refresh_UploadToBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
) { ) {
@ -805,7 +805,7 @@ void Refresh_UploadToBuffer(
device->UploadToBuffer( device->UploadToBuffer(
device->driverData, device->driverData,
commandBuffer, commandBuffer,
cpuBuffer, transferBuffer,
gpuBuffer, gpuBuffer,
copyParams copyParams
); );
@ -815,7 +815,7 @@ void Refresh_DownloadFromTexture(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
@ -823,7 +823,7 @@ void Refresh_DownloadFromTexture(
device->driverData, device->driverData,
commandBuffer, commandBuffer,
textureSlice, textureSlice,
cpuBuffer, transferBuffer,
copyParams copyParams
); );
} }
@ -832,7 +832,7 @@ void Refresh_DownloadFromBuffer(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
@ -840,7 +840,7 @@ void Refresh_DownloadFromBuffer(
device->driverData, device->driverData,
commandBuffer, commandBuffer,
gpuBuffer, gpuBuffer,
cpuBuffer, transferBuffer,
copyParams copyParams
); );
} }

View File

@ -214,7 +214,7 @@ struct Refresh_Device
uint32_t sizeInBytes uint32_t sizeInBytes
); );
Refresh_CpuBuffer* (*CreateCpuBuffer)( Refresh_TransferBuffer* (*CreateTransferBuffer)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
uint32_t sizeInBytes uint32_t sizeInBytes
); );
@ -236,9 +236,9 @@ struct Refresh_Device
Refresh_GpuBuffer *buffer Refresh_GpuBuffer *buffer
); );
void (*QueueDestroyCpuBuffer)( void (*QueueDestroyTransferBuffer)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CpuBuffer *buffer Refresh_TransferBuffer *buffer
); );
void (*QueueDestroyShaderModule)( void (*QueueDestroyShaderModule)(
@ -413,19 +413,19 @@ struct Refresh_Device
Refresh_CommandBuffer *commandBuffer Refresh_CommandBuffer *commandBuffer
); );
/* CpuBuffer Set/Get */ /* TransferBuffer Set/Get */
void (*SetData)( void (*SetData)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
void* data, void* data,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams, Refresh_BufferCopy *copyParams,
Refresh_SetDataOptions option Refresh_SetDataOptions option
); );
void (*GetData)( void (*GetData)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
void* data, void* data,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );
@ -440,7 +440,7 @@ struct Refresh_Device
void (*UploadToTexture)( void (*UploadToTexture)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
); );
@ -448,7 +448,7 @@ struct Refresh_Device
void (*UploadToBuffer)( void (*UploadToBuffer)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );
@ -457,7 +457,7 @@ struct Refresh_Device
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams
); );
@ -465,7 +465,7 @@ struct Refresh_Device
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_CpuBuffer *cpuBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams
); );
@ -592,11 +592,11 @@ struct Refresh_Device
ASSIGN_DRIVER_FUNC(CreateShaderModule, name) \ ASSIGN_DRIVER_FUNC(CreateShaderModule, name) \
ASSIGN_DRIVER_FUNC(CreateTexture, name) \ ASSIGN_DRIVER_FUNC(CreateTexture, name) \
ASSIGN_DRIVER_FUNC(CreateGpuBuffer, name) \ ASSIGN_DRIVER_FUNC(CreateGpuBuffer, name) \
ASSIGN_DRIVER_FUNC(CreateCpuBuffer, name) \ ASSIGN_DRIVER_FUNC(CreateTransferBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyTexture, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyTexture, name) \
ASSIGN_DRIVER_FUNC(QueueDestroySampler, name) \ ASSIGN_DRIVER_FUNC(QueueDestroySampler, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyGpuBuffer, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyGpuBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyCpuBuffer, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyTransferBuffer, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyShaderModule, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyShaderModule, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyComputePipeline, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyComputePipeline, name) \
ASSIGN_DRIVER_FUNC(QueueDestroyGraphicsPipeline, name) \ ASSIGN_DRIVER_FUNC(QueueDestroyGraphicsPipeline, name) \