sdlUploadToGpuBuffer function

void sdlUploadToGpuBuffer(
  1. Pointer<SdlGpuCopyPass> copyPass,
  2. Pointer<SdlGpuTransferBufferLocation> source,
  3. Pointer<SdlGpuBufferRegion> destination,
  4. bool cycle,
)

Uploads data from a transfer buffer to a buffer.

The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.

\param copy_pass a copy pass handle. \param source the source transfer buffer with offset. \param destination the destination buffer with offset and size. \param cycle if true, cycles the buffer if it is already bound, otherwise overwrites the data.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( SDL_GPUCopyPass *copy_pass, const SDL_GPUTransferBufferLocation *source, const SDL_GPUBufferRegion *destination, bool cycle)

Implementation

void sdlUploadToGpuBuffer(
    Pointer<SdlGpuCopyPass> copyPass,
    Pointer<SdlGpuTransferBufferLocation> source,
    Pointer<SdlGpuBufferRegion> destination,
    bool cycle) {
  final sdlUploadToGpuBufferLookupFunction = libSdl3.lookupFunction<
      Void Function(
          Pointer<SdlGpuCopyPass> copyPass,
          Pointer<SdlGpuTransferBufferLocation> source,
          Pointer<SdlGpuBufferRegion> destination,
          Uint8 cycle),
      void Function(
          Pointer<SdlGpuCopyPass> copyPass,
          Pointer<SdlGpuTransferBufferLocation> source,
          Pointer<SdlGpuBufferRegion> destination,
          int cycle)>('SDL_UploadToGPUBuffer');
  return sdlUploadToGpuBufferLookupFunction(
      copyPass, source, destination, cycle ? 1 : 0);
}