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

Provides utility functions that are common with interfacing with the GAL device. More...

#include <DeviceUtilities.h>

Public Types

enum class  IndexType { None , UShort , UInt }
 

Static Public Member Functions

static xiiEnum< xiiGALGraphicsAdapterVendorGetVendorFromID (xiiUInt32 uiID)
 This returns the graphics adapter vendor type from the given ID.
 
static xiiSharedPtr< xiiGALBufferCreateVertexBuffer (xiiGALDevice *pDevice, xiiUInt32 uiVertexSize, xiiUInt32 uiVertexCount, xiiArrayPtr< xiiUInt8 > pInitialData=xiiArrayPtr< xiiUInt8 >(), bool bDataIsMutable=false)
 Creates a vertex buffer with the given vertex size and vertex count.
 
static xiiSharedPtr< xiiGALBufferCreateIndexBuffer (xiiGALDevice *pDevice, IndexType indexType, xiiUInt32 uiIndexCount, xiiArrayPtr< xiiUInt8 > pInitialData=xiiArrayPtr< xiiUInt8 >(), bool bDataIsMutable=false)
 Creates an index buffer with the given index type and index count.
 
static xiiSharedPtr< xiiGALBufferCreateConstantBuffer (xiiGALDevice *pDevice, xiiUInt32 uiBufferSize, xiiStringView sDebugName={})
 Creates a constant buffer with the given size.
 
static xiiSharedPtr< xiiGALBufferCreateStagingBuffer (xiiGALDevice *pDevice, xiiUInt32 uiBufferSize, xiiStringView sDebugName={})
 Creates a staging buffer with the given size.
 
static xiiGALTextureCreationDescription CreateRenderTargetDescription (xiiSizeU32 size, xiiGALResourceFormat::Enum format, xiiUInt32 uiSampleCount=xiiGALMSAASampleCount::OneSample)
 Creates a render target description with the given parameters.
 
static xiiResult MapAndUpdateBuffer (xiiGALCommandList *pCommandList, xiiSharedPtr< xiiGALBuffer > pBuffer, xiiUInt32 uiDestinationOffset, xiiArrayPtr< const xiiUInt8 > pSourceData, xiiBitflags< xiiGALMapFlags > mapFlags=xiiGALMapFlags::Discard)
 Maps a buffer and updates it with the provided source data.
 

Detailed Description

Provides utility functions that are common with interfacing with the GAL device.

Member Enumeration Documentation

◆ IndexType

Enumerator
None 

Indices are not used, vertices are only used to form primitives.

UShort 

16 bit indices are used to select which vertices shall form a primitive, thus meshes can only use up to 65535 vertices.

UInt 

32 bit indices are used to select which vertices shall form a primitive.

Member Function Documentation

◆ CreateConstantBuffer()

xiiSharedPtr< xiiGALBuffer > xiiGALDeviceUtilities::CreateConstantBuffer ( xiiGALDevice * pDevice,
xiiUInt32 uiBufferSize,
xiiStringView sDebugName = {} )
staticnodiscard

Creates a constant buffer with the given size.

Parameters
pDevice- The device associated with the buffer.
uiBufferSize- The size of the buffer in bytes.
sDebugName- Optional debug name for the buffer.

◆ CreateIndexBuffer()

xiiSharedPtr< xiiGALBuffer > xiiGALDeviceUtilities::CreateIndexBuffer ( xiiGALDevice * pDevice,
IndexType indexType,
xiiUInt32 uiIndexCount,
xiiArrayPtr< xiiUInt8 > pInitialData = xiiArrayPtr<xiiUInt8>(),
bool bDataIsMutable = false )
staticnodiscard

Creates an index buffer with the given index type and index count.

Parameters
pDevice- The device associated with the buffer.
indexType- The index buffer type. See xiiGALDeviceUtilities::IndexType for details.
uiIndexCount- The number of indices in the buffer.
pInitialData- The initial data in bytes, that the buffer should contain after creation.
bDataIsMutable- Specifies whether the buffer should be considered immutable in its usage.

◆ CreateRenderTargetDescription()

xiiGALTextureCreationDescription xiiGALDeviceUtilities::CreateRenderTargetDescription ( xiiSizeU32 size,
xiiGALResourceFormat::Enum format,
xiiUInt32 uiSampleCount = xiiGALMSAASampleCount::OneSample )
staticnodiscard

Creates a render target description with the given parameters.

Parameters
size- The size (width and height) of the render target.
format- The render target format. See xiiGALResourceFormat for details.
uiSampleCount- The number of samples in the render target. The default is xiiGALMSAASampleCount::OneSample.

◆ CreateStagingBuffer()

xiiSharedPtr< xiiGALBuffer > xiiGALDeviceUtilities::CreateStagingBuffer ( xiiGALDevice * pDevice,
xiiUInt32 uiBufferSize,
xiiStringView sDebugName = {} )
staticnodiscard

Creates a staging buffer with the given size.

Parameters
pDevice- The device associated with the buffer.
uiBufferSize- The size of the buffer in bytes.
sDebugName- Optional debug name for the buffer.

◆ CreateVertexBuffer()

xiiSharedPtr< xiiGALBuffer > xiiGALDeviceUtilities::CreateVertexBuffer ( xiiGALDevice * pDevice,
xiiUInt32 uiVertexSize,
xiiUInt32 uiVertexCount,
xiiArrayPtr< xiiUInt8 > pInitialData = xiiArrayPtr<xiiUInt8>(),
bool bDataIsMutable = false )
staticnodiscard

Creates a vertex buffer with the given vertex size and vertex count.

Parameters
pDevice- The device associated with the buffer.
uiVertexSize- The size of a single vertex in the buffer.
uiVertexCount- The number of vertices in the buffer.
pInitialData- The initial data in bytes, that the buffer should contain after creation.
bDataIsMutable- Specifies whether the buffer should be considered immutable in its usage.

◆ MapAndUpdateBuffer()

xiiResult xiiGALDeviceUtilities::MapAndUpdateBuffer ( xiiGALCommandList * pCommandList,
xiiSharedPtr< xiiGALBuffer > pBuffer,
xiiUInt32 uiDestinationOffset,
xiiArrayPtr< const xiiUInt8 > pSourceData,
xiiBitflags< xiiGALMapFlags > mapFlags = xiiGALMapFlags::Discard )
static

Maps a buffer and updates it with the provided source data.

Parameters
pCommandList- Pointer to the command list.
hBuffer- Handle to the buffer to be updated.
uiDestinationOffset- Offset in the destination buffer where the data should be copied.
pSourceData- Array pointer to the source data to be copied.
mapFlags- Flags specifying the mapping behavior. Default is xiiGALMapFlags::Discard.
Returns
xiiResult indicating the success or failure of the operation.

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