![]() |
XII Release 0.1.0
|
Copyright (c) Theophilus Eriata. All Rights Reserved. More...
#include <MapHelper.h>
Public Member Functions | |
| xiiGALMapHelper () | |
| Default constructor. | |
| xiiGALMapHelper (xiiGALCommandList *pCommandList, xiiGALBuffer *pBuffer, xiiEnum< xiiGALMapType > mapType, xiiBitflags< xiiGALMapFlags > mapFlags) | |
| xiiGALMapHelper (xiiGALCommandList &commandList, xiiGALBuffer *pBuffer, xiiEnum< xiiGALMapType > mapType, xiiBitflags< xiiGALMapFlags > mapFlags) | |
| xiiGALMapHelper (xiiGALMapHelper &&other) noexcept | |
| ~xiiGALMapHelper () | |
| Destructor, automatically unmaps the resource. | |
| xiiGALMapHelper< DataType > & | operator= (xiiGALMapHelper &&other) noexcept |
| xiiResult | Map (xiiGALCommandList *pCommandList, xiiGALBuffer *pBuffer, xiiEnum< xiiGALMapType > mapType, xiiBitflags< xiiGALMapFlags > mapFlags) |
| xiiResult | Unmap () |
| operator DataType * () | |
| Implicit conversion to DataType pointer. | |
| operator const DataType * () const | |
| Implicit conversion to const DataType pointer. | |
| DataType * | operator-> () |
| const DataType * | operator-> () const |
| XII_ALWAYS_INLINE DataType * | GetMappedData () const |
Copyright (c) Theophilus Eriata. All Rights Reserved.
Helper class that automates resource mapping and unmapping.
This class simplifies the process of mapping and unmapping resources within a command list. It automatically maps the specified resource upon construction and unmaps it upon destruction.
| DataType | The type of data that will be mapped. |
Usage example:
| XII_ALWAYS_INLINE xiiGALMapHelper< DataType >::xiiGALMapHelper | ( | ) |
Default constructor.
Copyright (c) Theophilus Eriata. All Rights Reserved.
| XII_ALWAYS_INLINE xiiGALMapHelper< DataType >::xiiGALMapHelper | ( | xiiGALCommandList * | pCommandList, |
| xiiGALBuffer * | pBuffer, | ||
| xiiEnum< xiiGALMapType > | mapType, | ||
| xiiBitflags< xiiGALMapFlags > | mapFlags ) |
Constructs the helper and maps the specified resource.
| pCommandList | - Pointer to the command list. |
| hBuffer | - Handle to the buffer resource. |
| mapType | - Type of mapping operation. |
| mapFlags | - Mapping flags. |
| XII_ALWAYS_INLINE xiiGALMapHelper< DataType >::xiiGALMapHelper | ( | xiiGALCommandList & | commandList, |
| xiiGALBuffer * | pBuffer, | ||
| xiiEnum< xiiGALMapType > | mapType, | ||
| xiiBitflags< xiiGALMapFlags > | mapFlags ) |
Constructs the helper and maps the specified resource.
| commandList | - Reference to the command list. |
| hBuffer | - Handle to the buffer resource. |
| mapType | - Type of mapping operation. |
| mapFlags | - Mapping flags. |
|
noexcept |
Move constructor.
| other | - The other helper object to move from. |
| XII_ALWAYS_INLINE DataType * xiiGALMapHelper< DataType >::GetMappedData | ( | ) | const |
Returns a pointer to the mapped buffer data.
This function provides direct access to the memory where the buffer is mapped. It is typically used for reading from or writing to GPU buffer memory directly, assuming the buffer has been properly mapped beforehand.
| XII_FORCE_INLINE xiiResult xiiGALMapHelper< DataType >::Map | ( | xiiGALCommandList * | pCommandList, |
| xiiGALBuffer * | pBuffer, | ||
| xiiEnum< xiiGALMapType > | mapType, | ||
| xiiBitflags< xiiGALMapFlags > | mapFlags ) |
Maps the specified resource.
| pCommandList | - Pointer to the command list. |
| hBuffer | - Handle to the buffer resource. |
| mapType | - Type of mapping operation. |
| mapFlags | - Mapping flags. |
| XII_ALWAYS_INLINE DataType * xiiGALMapHelper< DataType >::operator-> | ( | ) |
Provides direct access to the mapped data.
| XII_ALWAYS_INLINE const DataType * xiiGALMapHelper< DataType >::operator-> | ( | ) | const |
Provides direct access to the mapped data (const version).
|
noexcept |
Move assignment operator.
| other | - The other helper object to move from. |
| XII_FORCE_INLINE xiiResult xiiGALMapHelper< DataType >::Unmap | ( | ) |
Unmaps the specified resource.