SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::GPUTransferBuffer Class Reference

An opaque handle representing a transfer buffer. More...

Public Member Functions

constexpr GPUTransferBuffer (GPUTransferBufferRaw gPUTransferBuffer={})
 Wraps GPUTransferBuffer. More...
 
 GPUTransferBuffer (GPUDeviceParam device, const GPUTransferBufferCreateInfo &createinfo)
 Creates a transfer buffer to be used when uploading to or downloading from graphics resources. More...
 
constexpr bool operator== (const GPUTransferBuffer &other) const =default
 Default comparison operator.
 
constexpr bool operator== (GPUTransferBufferRaw gPUTransferBuffer) const
 Compares with the underlying type.
 
constexpr operator GPUTransferBufferRaw () const
 Unwraps to the underlying GPUTransferBuffer. More...
 

Detailed Description

Used for transferring data to and from the device.

Since
This struct is available since SDL 3.2.0.
See also
GPUTransferBuffer.GPUTransferBuffer
GPUDevice.MapTransferBuffer
GPUDevice.UnmapTransferBuffer
GPUCopyPass.UploadToBuffer
GPUCopyPass.UploadToTexture
GPUCopyPass.DownloadFromBuffer
GPUCopyPass.DownloadFromTexture
GPUDevice.ReleaseTransferBuffer

Constructor & Destructor Documentation

◆ GPUTransferBuffer() [1/2]

constexpr SDL::GPUTransferBuffer::GPUTransferBuffer ( GPUTransferBufferRaw  gPUTransferBuffer = {})
inlineconstexpr
Parameters
gPUTransferBufferthe value to be wrapped

◆ GPUTransferBuffer() [2/2]

SDL::GPUTransferBuffer::GPUTransferBuffer ( GPUDeviceParam  device,
const GPUTransferBufferCreateInfo createinfo 
)
inline

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:

  • prop::GPUTransferBuffer.CREATE_NAME_STRING: a name that can be displayed in debugging tools.
Parameters
devicea GPU Context.
createinfoa struct describing the state of the transfer buffer to create.
Postcondition
a transfer buffer on success.
Exceptions
Erroron failure.
Since
This function is available since SDL 3.2.0.
See also
GPUCopyPass.UploadToBuffer
GPUCopyPass.DownloadFromBuffer
GPUCopyPass.UploadToTexture
GPUCopyPass.DownloadFromTexture
GPUDevice.ReleaseTransferBuffer

Member Function Documentation

◆ operator GPUTransferBufferRaw()

constexpr SDL::GPUTransferBuffer::operator GPUTransferBufferRaw ( ) const
inlineconstexpr
Returns
the underlying GPUTransferBufferRaw.

The documentation for this class was generated from the following file: