sdlxUploadToGpuTexture function gpu
void
sdlxUploadToGpuTexture(
- Pointer<
SdlGpuCopyPass> copyPass, - SdlxGpuTextureTransferInfo source,
- SdlxGpuTextureRegion destination,
- bool cycle,
Uploads data from a transfer buffer to a texture.
The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.
You must align the data in the transfer buffer to a multiple of the texel size of the texture format.
\param copy_pass a copy pass handle. \param source the source transfer buffer with image layout information. \param destination the destination texture region. \param cycle if true, cycles the texture if the texture is bound, otherwise overwrites the data.
\since This function is available since SDL 3.2.0.
extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureTransferInfo *source, const SDL_GPUTextureRegion *destination, bool cycle)
Implementation
void sdlxUploadToGpuTexture(
Pointer<SdlGpuCopyPass> copyPass,
SdlxGpuTextureTransferInfo source,
SdlxGpuTextureRegion destination,
bool cycle,
) {
final sourcePointer = source.calloc();
final destinationPointer = destination.calloc();
sdlUploadToGpuTexture(copyPass, sourcePointer, destinationPointer, cycle);
sourcePointer.callocFree();
destinationPointer.callocFree();
}