Foundation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
UploadGPURingBuffer< T > Struct Template Reference

Public Member Functions

 UploadGPURingBuffer (RHIDevice *device, size_t budget)
 
Pair< T *, uint32_tAllocate (uint32_t count)
 
void Reset ()
 
uint32_t Used () const
 
uint32_t Capacity () const
 

Public Attributes

RHIDeviceScopedHandle< RHIBuffermBuffer
 
TmBegin
 
TmPrevRing
 
TmRing
 
TmEnd
 

Constructor & Destructor Documentation

◆ UploadGPURingBuffer()

template<typename T >
UploadGPURingBuffer< T >::UploadGPURingBuffer ( RHIDevice device,
size_t  budget 
)
inline

Member Function Documentation

◆ Allocate()

template<typename T >
Pair< T *, uint32_t > UploadGPURingBuffer< T >::Allocate ( uint32_t  count)
inline

@breif Allocates count T elements in the ring buffer, returning a Span to the allocated memory. It's up to the caller to fill in the data, which is usually write-only.

Note
There's no guard against allocating potentially still in-flight memory range. Ensure enough memory budget to avoid overwriting.
Returns
Raw mapped memory ptr, offset (element wise) in buffer.

◆ Capacity()

template<typename T >
uint32_t UploadGPURingBuffer< T >::Capacity ( ) const
inline

◆ Reset()

template<typename T >
void UploadGPURingBuffer< T >::Reset ( )
inline

◆ Used()

template<typename T >
uint32_t UploadGPURingBuffer< T >::Used ( ) const
inline

Member Data Documentation

◆ mBegin

template<typename T >
T* UploadGPURingBuffer< T >::mBegin

◆ mBuffer

◆ mEnd

template<typename T >
T * UploadGPURingBuffer< T >::mEnd

◆ mPrevRing

template<typename T >
T * UploadGPURingBuffer< T >::mPrevRing

◆ mRing

template<typename T >
T * UploadGPURingBuffer< T >::mRing

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