|
SleakEngine 0.1.0
C++23 multi-backend game engine
|
D3D11 buffer wrapper covering vertex/index/constant usages and custom configurations. More...
#include <DirectX11Buffer.hpp>
Public Member Functions | |
| DirectX11Buffer (const DirectX11Buffer &)=delete | |
| DirectX11Buffer (DirectX11Buffer &&) noexcept | |
| DirectX11Buffer (ID3D11Device *device, size_t size, BufferType type) | |
| Derives usage/bind/CPU-access flags from the buffer type via ConfigureFromBufferType. | |
| DirectX11Buffer (ID3D11Device *device, size_t size, D3D11_USAGE usage, UINT bindFlags, UINT cpuAccessFlags) | |
| ~DirectX11Buffer () override | |
| void | Cleanup () override |
| UINT | GetBindFlags () const |
| UINT | GetCPUAccessFlags () const |
| ID3D11Buffer * | GetD3DBuffer () const |
| void * | GetData () override |
| Returns CPU-visible data directly for readable buffers, or round-trips GPU-only buffers through a staging copy. | |
| D3D11_USAGE | GetUsage () const |
| bool | Initialize (const void *data, uint16_t size) |
| Creates the buffer sized and pre-populated from a raw payload. | |
| bool | Initialize (void *Data) override |
| Creates the D3D11 buffer resource and uploads initial data, if any. | |
| bool | IsValid () const |
| bool | Map () override |
| Maps the buffer for CPU writes (dynamic usage only). | |
| DirectX11Buffer & | operator= (const DirectX11Buffer &)=delete |
| DirectX11Buffer & | operator= (DirectX11Buffer &&) noexcept |
| void | Unmap () override |
| void | Update () override |
| void | Update (void *data, size_t size) override |
| Overwrites buffer contents via UpdateSubresource/Map depending on usage. | |
| Public Member Functions inherited from Sleak::RenderEngine::BufferBase | |
| const void * | GetCPUShadowCopy () const |
| size_t | GetCPUShadowCopySize () const |
| size_t | GetSize () |
| int | GetSlot () const |
| BufferType | GetType () |
| uint32_t | GetVertexFormat () const |
| Registered custom vertex layout of this buffer; 0 means the engine default Vertex. | |
| void | SetSlot (int slot) |
| void | SetVertexFormat (uint32_t handle) |
| Tags the buffer with a VertexFormatRegistry handle so backends pick the matching pipeline. | |
| void | StoreCPUShadowCopy (const void *data, size_t size) |
| Copies up to 128 bytes into the inline shadow-copy storage, clamping oversized input. | |
| Public Member Functions inherited from Sleak::ResourceBase | |
| virtual | ~ResourceBase ()=default |
Additional Inherited Members | |
| Protected Attributes inherited from Sleak::RenderEngine::BufferBase | |
| bool | bIsMapped = false |
| void * | Data = nullptr |
| const void * | m_cpuShadowCopy = nullptr |
| size_t | m_cpuShadowCopySize = 0 |
| char | m_cpuShadowStorage [128] = {} |
| uint32_t | m_vertexFormat = 0 |
| size_t | Size = 0 |
| int | Slot = 0 |
| BufferType | Type |
| Protected Attributes inherited from Sleak::ResourceBase | |
| bool | bIsInitialized |
| std::string | Name |
D3D11 buffer wrapper covering vertex/index/constant usages and custom configurations.
Definition at line 14 of file DirectX11Buffer.hpp.
| Sleak::RenderEngine::DirectX11Buffer::DirectX11Buffer | ( | ID3D11Device * | device, |
| size_t | size, | ||
| BufferType | type ) |
Derives usage/bind/CPU-access flags from the buffer type via ConfigureFromBufferType.
Definition at line 11 of file DirectX11Buffer.cpp.
| Sleak::RenderEngine::DirectX11Buffer::DirectX11Buffer | ( | ID3D11Device * | device, |
| size_t | size, | ||
| D3D11_USAGE | usage, | ||
| UINT | bindFlags, | ||
| UINT | cpuAccessFlags ) |
Definition at line 22 of file DirectX11Buffer.cpp.
|
delete |
|
noexcept |
Definition at line 35 of file DirectX11Buffer.cpp.
|
override |
Definition at line 67 of file DirectX11Buffer.cpp.
|
overridevirtual |
Implements Sleak::ResourceBase.
Definition at line 160 of file DirectX11Buffer.cpp.
|
inline |
Definition at line 55 of file DirectX11Buffer.hpp.
|
inline |
Definition at line 56 of file DirectX11Buffer.hpp.
|
inline |
Definition at line 50 of file DirectX11Buffer.hpp.
|
overridevirtual |
Returns CPU-visible data directly for readable buffers, or round-trips GPU-only buffers through a staging copy.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 228 of file DirectX11Buffer.cpp.
|
inline |
Definition at line 54 of file DirectX11Buffer.hpp.
| bool Sleak::RenderEngine::DirectX11Buffer::Initialize | ( | const void * | data, |
| uint16_t | size ) |
Creates the buffer sized and pre-populated from a raw payload.
Definition at line 117 of file DirectX11Buffer.cpp.
|
overridevirtual |
Creates the D3D11 buffer resource and uploads initial data, if any.
Implements Sleak::ResourceBase.
Definition at line 113 of file DirectX11Buffer.cpp.
|
inline |
Definition at line 53 of file DirectX11Buffer.hpp.
|
overridevirtual |
Maps the buffer for CPU writes (dynamic usage only).
Implements Sleak::RenderEngine::BufferBase.
Definition at line 173 of file DirectX11Buffer.cpp.
|
delete |
|
noexcept |
Definition at line 48 of file DirectX11Buffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 194 of file DirectX11Buffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 140 of file DirectX11Buffer.cpp.
|
overridevirtual |
Overwrites buffer contents via UpdateSubresource/Map depending on usage.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 203 of file DirectX11Buffer.cpp.