XII Release 0.1.0
Loading...
Searching...
No Matches
xiiGALDynamicBuffer Class Reference

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <DynamicBuffer.h>

Inheritance diagram for xiiGALDynamicBuffer:
[legend]

Public Member Functions

 xiiGALDynamicBuffer (xiiSharedPtr< xiiGALDevice > pDevice, const xiiGALBufferCreationDescription &description)
xiiGALBufferCreationDescription GetDescription () const
 Returns the buffer description.
xiiSharedPtr< xiiGALBuffer > GetBuffer () const
XII_ALWAYS_INLINE xiiUInt32 GetVersion () const
 Returns the dynamic buffer version. The version is incremented whenever a new internal buffer is created.
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< xiiGALBuffer > Resize (xiiSharedPtr< xiiGALCommandList > pCommandList, xiiUInt64 uiNewSize, bool bDiscardContent=false)
xiiSharedPtr< xiiGALBuffer > Update (xiiSharedPtr< xiiGALCommandList > pCommandList)
Public Member Functions inherited from xiiGALObject
XII_ALWAYS_INLINE xiiStringView GetDebugName () const
 Returns the debug name of this resource.
void SetDebugName (xiiStringView sDebugName) const
 Sets the debug name for this resource.
Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTI * GetDynamicRTTI () const
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
Public Member Functions inherited from xiiRefCounted
virtual ~xiiRefCounted ()=default
 Adds a virtual destructor.
Public Member Functions inherited from xiiRefCountingImpl
 xiiRefCountingImpl ()=default
 Constructor.
 xiiRefCountingImpl (const xiiRefCountingImpl &rhs)
void operator= (const xiiRefCountingImpl &rhs)
xiiUInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
bool TryAddRef () const
xiiUInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.ywat.
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
xiiUInt32 GetRefCount () const
 Returns the current reference count.

Additional Inherited Members

Static Public Member Functions inherited from xiiNoBase
static const xiiRTTI * GetStaticRTTI ()
Protected Member Functions inherited from xiiGALObject
 xiiGALObject ()
 Copyright (c) Theophilus Eriata. All Rights Reserved.
virtual XII_ALWAYS_INLINE void SetDebugNamePlatform (xiiStringView sName) const

Detailed Description

Copyright (c) Theophilus Eriata. All Rights Reserved.

Constructor & Destructor Documentation

◆ xiiGALDynamicBuffer()

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

Member Function Documentation

◆ GetBuffer()

xiiSharedPtr< xiiGALBuffer > xiiGALDynamicBuffer::GetBuffer ( ) const
nodiscard

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 non-null, existing contents are copied to the new internal buffer. If pCommandList is null, the new internal buffer is created but existing contents are not copied. If uiNewSize is zero, 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:
  • /home/runner/work/XII/XII/Source/Engine/GraphicsFoundation/Tools/DynamicBuffer.h
  • /home/runner/work/XII/XII/Source/Engine/GraphicsFoundation/Tools/Implementation/DynamicBuffer.cpp