class
GpuResourceData
You can use this class as a storage for reading and writing from/to various GPU resources.
It is meant to be created on main thread and used on the render thread. This class is abstract and specific resource types need to implement their own type of GpuResourceData.
Public
Constructors
GpuResourceData
GpuResourceData
Methods
~GpuResourceData
GetData
Returns pointer to the internal buffer.
SetData
Sets the internal pointer to point at provided data.
GpuResourceData takes ownership of provided memory.
AllocateInternalBuffer
Allocates an internal buffer of a certain size.
If there is another buffer already allocated, it will be freed and new one will be allocated. Buffer size is determined based on parameters used for initializing the class.
AllocateInternalBuffer
Allocates an internal buffer of a certain size.
If there is another buffer already allocated, it will be freed and new one will be allocated.
- size
- The size of the buffer in bytes.
FreeInternalBuffer
Frees the internal buffer that was allocated using allocateInternalBuffer().
Called automatically when the instance of the class is destroyed.
SetExternalBuffer
Makes the internal data pointer point to some external data.
No copying is done, so you must ensure that external data exists as long as this class uses it. You are also responsible for deleting the data when you are done with it.
IsLocked
Checks if the internal buffer is locked due to some other thread using it.
LockInternal
Locks the data and makes it available only to the render thread.
UnlockInternal
Unlocks the data and makes it available to all threads.
staticGetRttiStatic
Operators
operator=
Protected
Methods
GetInternalBufferSize
Returns the size of the internal buffer in bytes.
This is calculated based on parameters provided upon construction and specific implementation details.