XII Release 0.1.0
Loading...
Searching...
No Matches
xiiGALDynamicBuffer Class Reference
Inheritance diagram for xiiGALDynamicBuffer:
[legend]

Public Member Functions

 xiiGALDynamicBuffer (xiiSharedPtr< xiiGALDevice > pDevice, const xiiGALBufferCreationDescription &description)
 
XII_ALWAYS_INLINE const xiiGALBufferCreationDescriptionGetDescription () const
 Returns the buffer description.
 
XII_ALWAYS_INLINE xiiSharedPtr< xiiGALBufferGetBuffer () const
 Returns a reference-counted pointer to the buffer object.
 
XII_ALWAYS_INLINE xiiUInt32 GetVersion () const
 Returns the dynamic buffer version. The version is incremented whenever a new internal buffer is created.
 
XII_ALWAYS_INLINE bool PendingUpdate () const
 Returns true if the buffer must be updated before use (e.g., it has been resized, but the internal buffer has not been initialized or updated). When update is not pending, Update() may be called with null command list.
 
xiiSharedPtr< xiiGALBufferResize (xiiSharedPtr< xiiGALCommandList > pCommandList, xiiUInt64 uiNewSize, bool bDiscardContent=false)
 Resizes the buffer to the new size.
 
xiiSharedPtr< xiiGALBufferUpdate (xiiSharedPtr< xiiGALCommandList > pCommandList)
 Updates the internal buffer object, initializing or resizing as necessary.
 

Constructor & Destructor Documentation

◆ xiiGALDynamicBuffer()

xiiGALDynamicBuffer::xiiGALDynamicBuffer ( xiiSharedPtr< xiiGALDevice > pDevice,
const xiiGALBufferCreationDescription & description )
Todo
Support sparse buffer.

Member Function Documentation

◆ GetBuffer()

XII_ALWAYS_INLINE xiiSharedPtr< xiiGALBuffer > xiiGALDynamicBuffer::GetBuffer ( ) const
inlinenodiscard

Returns a reference-counted pointer to the buffer object.

Remarks
If the buffer has not been initialized, the method returns null. If the buffer may need to be updated (resized or initialized), use the Update() method.

◆ Resize()

xiiSharedPtr< xiiGALBuffer > xiiGALDynamicBuffer::Resize ( xiiSharedPtr< xiiGALCommandList > pCommandList,
xiiUInt64 uiNewSize,
bool bDiscardContent = false )

Resizes the buffer to the new size.

Parameters
pCommandList- The command list that will be used to copy existing contents to the new buffer. This parameter may be null (see remarks).
uiNewSize- The new buffer size. This may be zero.
bDiscardContent- Whether to discard previous buffer content.
Returns
A reference-counted pointer to the new buffer.
Remarks
If pCommandList is null, then the new internal buffer is created and existing contents is copied. Otherwise, the new internal buffer is created, but existing contents are not copied. If uiNewSize is zero, then the internal buffer will be released.

◆ Update()

xiiSharedPtr< xiiGALBuffer > xiiGALDynamicBuffer::Update ( xiiSharedPtr< xiiGALCommandList > pCommandList)

Updates the internal buffer object, initializing or resizing as necessary.

Parameters
pCommandList- The command list that will be used to copy existing contents to the new buffer. This parameter may be null (see remarks).
Returns
A reference-counted pointer to the new buffer.
Remarks
If the buffer has been resized, but the internal buffer has not been initialized, pCommandList must not be null. If the buffer does not need to be updated (PendingUpdate() returns false), pCommandList may be null.

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