From 218587bb6a5b0058d4137528ff74f4478f9ce5e6 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 15 Feb 2024 17:27:40 -0800 Subject: [PATCH] rearrange copy params order --- include/Refresh.h | 10 ++++++---- src/Refresh.c | 16 ++++++++-------- src/Refresh_Driver.h | 8 ++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/Refresh.h b/include/Refresh.h index a527c63..8594c1d 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -1064,6 +1064,8 @@ REFRESHAPI void Refresh_EndComputePass( /* CpuBuffer Map */ /* Maps a CpuBuffer to host memory. Returns a pointer that can be copied to. + * + * NOTE: Mapping a CpuBuffer that is already mapped is an error. * * offsetInBytes: The offset of the buffer to map. * sizeInBytes: The number of bytes of memory to map. @@ -1102,8 +1104,8 @@ REFRESHAPI void Refresh_UploadToTexture( Refresh_Device *device, Refresh_CommandBuffer *commandBuffer, Refresh_CpuBuffer *cpuBuffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ); /* Uploads data from a CpuBuffer to a GpuBuffer. */ @@ -1165,8 +1167,8 @@ REFRESHAPI void Refresh_CopyBufferToTexture( Refresh_Device *device, Refresh_CommandBuffer *commandBuffer, Refresh_GpuBuffer *buffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ); /* Copies data from a buffer to a buffer. */ diff --git a/src/Refresh.c b/src/Refresh.c index d5c24fc..3384950 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -793,16 +793,16 @@ void Refresh_UploadToTexture( Refresh_Device *device, Refresh_CommandBuffer *commandBuffer, Refresh_CpuBuffer *cpuBuffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ) { NULL_RETURN(device); device->UploadToTexture( device->driverData, commandBuffer, cpuBuffer, - copyParams, - textureSlice + textureSlice, + copyParams ); } @@ -893,16 +893,16 @@ void Refresh_CopyBufferToTexture( Refresh_Device *device, Refresh_CommandBuffer *commandBuffer, Refresh_GpuBuffer *buffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ) { NULL_RETURN(device); device->CopyBufferToTexture( device->driverData, commandBuffer, buffer, - copyParams, - textureSlice + textureSlice, + copyParams ); } diff --git a/src/Refresh_Driver.h b/src/Refresh_Driver.h index 2514efa..949c191 100644 --- a/src/Refresh_Driver.h +++ b/src/Refresh_Driver.h @@ -447,8 +447,8 @@ struct Refresh_Device Refresh_Renderer *driverData, Refresh_CommandBuffer *commandBuffer, Refresh_CpuBuffer *cpuBuffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ); void (*UploadToBuffer)( @@ -494,8 +494,8 @@ struct Refresh_Device Refresh_Renderer *driverData, Refresh_CommandBuffer *commandBuffer, Refresh_GpuBuffer *buffer, - Refresh_BufferImageCopy *copyParams, - Refresh_TextureSlice *textureSlice + Refresh_TextureSlice *textureSlice, + Refresh_BufferImageCopy *copyParams ); void (*CopyBufferToBuffer)(