implement resource containers
continuous-integration/drone/push Build is passing Details

pull/51/head
cosmonaut 2024-02-28 19:09:44 -08:00
parent 126375c5e3
commit e88580ae64
4 changed files with 475 additions and 339 deletions

View File

@ -1144,7 +1144,8 @@ REFRESHAPI void Refresh_DownloadFromTexture(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams,
Refresh_TransferOptions option
); );
/* Downloads data from a GpuBuffer object. */ /* Downloads data from a GpuBuffer object. */
@ -1153,13 +1154,29 @@ REFRESHAPI void Refresh_DownloadFromBuffer(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams,
Refresh_TransferOptions option
); );
/* GPU-to-GPU copies occur on the GPU timeline, /* GPU-to-GPU copies occur on the GPU timeline,
* and you may assume the copy has finished in subsequent commands. * and you may assume the copy has finished in subsequent commands.
*/ */
/*
* option:
* SAFEDISCARD:
* If the destination resource 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.
* Otherwise the data will safely overwrite.
* This is a good option to prevent stalls on resources with frequent updates.
* It is not recommended to use this option with large resources.
*
* SAFEOVERWRITE:
* Overwrites the data regardless of whether a copy has been issued.
* This will insert a memory barrier, so it could cause suboptimal performance compared to SAFEDISCARD
* on resources that update frequently across submissions.
*/
/* Performs a texture-to-texture copy. */ /* Performs a texture-to-texture copy. */
REFRESHAPI void Refresh_CopyTextureToTexture( REFRESHAPI void Refresh_CopyTextureToTexture(
Refresh_Device *device, Refresh_Device *device,

View File

@ -820,7 +820,8 @@ void Refresh_DownloadFromTexture(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams,
Refresh_TransferOptions option
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
device->DownloadFromTexture( device->DownloadFromTexture(
@ -828,7 +829,8 @@ void Refresh_DownloadFromTexture(
commandBuffer, commandBuffer,
textureSlice, textureSlice,
transferBuffer, transferBuffer,
copyParams copyParams,
option
); );
} }
@ -837,7 +839,8 @@ void Refresh_DownloadFromBuffer(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams,
Refresh_TransferOptions option
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
device->DownloadFromBuffer( device->DownloadFromBuffer(
@ -845,7 +848,8 @@ void Refresh_DownloadFromBuffer(
commandBuffer, commandBuffer,
gpuBuffer, gpuBuffer,
transferBuffer, transferBuffer,
copyParams copyParams,
option
); );
} }

View File

@ -460,7 +460,8 @@ struct Refresh_Device
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferImageCopy *copyParams Refresh_BufferImageCopy *copyParams,
Refresh_TransferOptions option
); );
void (*DownloadFromBuffer)( void (*DownloadFromBuffer)(
@ -468,7 +469,8 @@ struct Refresh_Device
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_GpuBuffer *gpuBuffer, Refresh_GpuBuffer *gpuBuffer,
Refresh_TransferBuffer *transferBuffer, Refresh_TransferBuffer *transferBuffer,
Refresh_BufferCopy *copyParams Refresh_BufferCopy *copyParams,
Refresh_TransferOptions option
); );
void (*CopyTextureToTexture)( void (*CopyTextureToTexture)(

File diff suppressed because it is too large Load Diff