sdlCreateGpuTransferBuffer function gpu

Pointer<SdlGpuTransferBuffer> sdlCreateGpuTransferBuffer(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlGpuTransferBufferCreateInfo> createinfo
)

Creates a transfer buffer to be used when uploading to or downloading from graphics resources.

Download buffers can be particularly expensive to create, so it is good practice to reuse them if data will be downloaded regularly.

There are optional properties that can be provided through props. These are the supported properties:

  • SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING: a name that can be displayed in debugging tools.

\param device a GPU Context. \param createinfo a struct describing the state of the transfer buffer to create. \returns a transfer buffer on success, or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.2.0.

\sa SDL_UploadToGPUBuffer \sa SDL_DownloadFromGPUBuffer \sa SDL_UploadToGPUTexture \sa SDL_DownloadFromGPUTexture \sa SDL_ReleaseGPUTransferBuffer

extern SDL_DECLSPEC SDL_GPUTransferBuffer * SDLCALL SDL_CreateGPUTransferBuffer( SDL_GPUDevice *device, const SDL_GPUTransferBufferCreateInfo *createinfo)

Implementation

Pointer<SdlGpuTransferBuffer> sdlCreateGpuTransferBuffer(
  Pointer<SdlGpuDevice> device,
  Pointer<SdlGpuTransferBufferCreateInfo> createinfo,
) {
  final sdlCreateGpuTransferBufferLookupFunction = _libSdl
      .lookupFunction<
        Pointer<SdlGpuTransferBuffer> Function(
          Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTransferBufferCreateInfo> createinfo,
        ),
        Pointer<SdlGpuTransferBuffer> Function(
          Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTransferBufferCreateInfo> createinfo,
        )
      >('SDL_CreateGPUTransferBuffer');
  return sdlCreateGpuTransferBufferLookupFunction(device, createinfo);
}