Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
BufferImpl Class Referencefinal

A D3D11-based Buffer implementation. More...

#include <Buffer11.h>

Inherits Buffer.

Public Member Functions

 BufferImpl (ID3D11Device *device, ID3D11DeviceContext *context, size_t size, BufferType type, BufferUsage usage, const void *initial, uint32_t stride=0)
void updateData (const void *data, size_t size) override
 Update buffer data.
void updateSubData (const void *data, size_t offset, size_t size) override
 Update buffer sub-region data.
void usingDefaultStoredData (bool needDefaultStoredData) override
 By default, static buffer data will automatically stored when it comes to foreground.
ID3D11ShaderResourceView * getSRV () const noexcept
 Get (and lazily create) a shader-resource view for this storage buffer.
ID3D11UnorderedAccessView * getUAV () const noexcept
 Get (and lazily create) an unordered-access view for this storage buffer.
Public Member Functions inherited from Buffer
size_t getSize () const
 Get buffer size in bytes.
uint32_t getStride () const
 Get the logical storage element stride in bytes.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Object * autorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
uint64_t getObjectID () const noexcept
 Returns the process-local diagnostic identifier assigned at construction.
virtual ~Object ()
 Destructor.

Detailed Description

A D3D11-based Buffer implementation.

Constructor & Destructor Documentation

◆ BufferImpl()

BufferImpl ( ID3D11Device * device,
ID3D11DeviceContext * context,
size_t size,
BufferType type,
BufferUsage usage,
const void * initial,
uint32_t stride = 0 )
Parameters
devicecreated device from driver impl
contextthe context related to device
sizerequest size of buffer
typeBufferType::VERTEX or BufferType::INDEX
usageBufferUsage::STATIC / DYNAMIC / STREAM
initialinitial data
stridelogical storage element stride in bytes (0 when unspecified)

Member Function Documentation

◆ updateData()

void updateData ( const void * data,
size_t size )
overridevirtual

Update buffer data.

Parameters
dataSpecifies a pointer to data that will be copied into the data store for initialization.
sizeSpecifies the size in bytes of the data store region being replaced.
See also
updateSubData(void* data, unsigned int offset, unsigned int size)

Implements Buffer.

◆ updateSubData()

void updateSubData ( const void * data,
size_t offset,
size_t size )
overridevirtual

Update buffer sub-region data.

Parameters
dataSpecifies a pointer to the new data that will be copied into the data store.
offsetSpecifies the offset into the buffer object's data store where data replacement will begin, measured in bytes.
sizeSpecifies the size in bytes of the data store region being replaced.
See also
updateData(void* data, unsigned int size)

Implements Buffer.

◆ usingDefaultStoredData()

void usingDefaultStoredData ( bool needDefaultStoredData)
overridevirtual

By default, static buffer data will automatically stored when it comes to foreground.

This function is used to indicate whether external data needs to be used to update the buffer instead of using the default stored data.

Parameters
needDefaultStoredDataSpecifies whether to use the default stored data.

Implements Buffer.

◆ getSRV()

ID3D11ShaderResourceView * getSRV ( ) const
noexcept

Get (and lazily create) a shader-resource view for this storage buffer.

Returns
The SRV, or null if the buffer cannot expose one.

◆ getUAV()

ID3D11UnorderedAccessView * getUAV ( ) const
noexcept

Get (and lazily create) an unordered-access view for this storage buffer.

Returns
The UAV, or null if the buffer cannot expose one.

The documentation for this class was generated from the following file:
  • Buffer11.h