|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
D3D12 buffer wrapper: default-heap resource plus an upload heap for CPU-to-GPU copies. More...
#include <DirectX12Buffer.hpp>
Public Member Functions | |
| DirectX12Buffer (const DirectX12Buffer &)=delete | |
| DirectX12Buffer (DirectX12Buffer &&) noexcept | |
| DirectX12Buffer (ID3D12Device *device, ID3D12CommandQueue *queue, size_t size, BufferType type) | |
| DirectX12Buffer (ID3D12Device *device, size_t size, D3D12_HEAP_TYPE heapType, D3D12_RESOURCE_STATES resourceState) | |
| ~DirectX12Buffer () override | |
| void | Cleanup () override |
| ID3D12GraphicsCommandList * | GetCommandList () const |
| ID3D12Resource * | GetD3DBuffer () const |
| void * | GetData () override |
| D3D12_HEAP_TYPE | GetHeapType () const |
| D3D12_RESOURCE_STATES | GetResourceState () const |
| bool | HasPendingCommands () const |
| bool | Initialize (const void *data, size_t size) |
| Creates the buffer sized and pre-populated from a raw payload. | |
| bool | Initialize (void *Data) override |
| Creates the default-heap resource and uploads initial data via a staging buffer, if any. | |
| bool | IsValid () const |
| bool | Map () override |
| Maps the buffer for CPU writes (upload-heap buffers only). | |
| DirectX12Buffer & | operator= (const DirectX12Buffer &)=delete |
| DirectX12Buffer & | operator= (DirectX12Buffer &&) noexcept |
| void | ReleaseUploadResources () |
| void | Unmap () override |
| void | Update () override |
| void | Update (void *data, size_t size) override |
| Overwrites buffer contents via a fresh upload-heap copy. | |
| 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 |
Static Public Member Functions | |
| static void | DeferCleanup (Microsoft::WRL::ComPtr< ID3D12Resource > resource) |
| static void | ProcessDeferredCleanup () |
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 |
D3D12 buffer wrapper: default-heap resource plus an upload heap for CPU-to-GPU copies.
Definition at line 11 of file DirectX12Buffer.hpp.
| Sleak::RenderEngine::DirectX12Buffer::DirectX12Buffer | ( | ID3D12Device * | device, |
| ID3D12CommandQueue * | queue, | ||
| size_t | size, | ||
| BufferType | type ) |
Definition at line 8 of file DirectX12Buffer.cpp.
| Sleak::RenderEngine::DirectX12Buffer::DirectX12Buffer | ( | ID3D12Device * | device, |
| size_t | size, | ||
| D3D12_HEAP_TYPE | heapType, | ||
| D3D12_RESOURCE_STATES | resourceState ) |
Definition at line 19 of file DirectX12Buffer.cpp.
|
delete |
|
noexcept |
Definition at line 30 of file DirectX12Buffer.cpp.
|
override |
Definition at line 70 of file DirectX12Buffer.cpp.
|
overridevirtual |
Implements Sleak::ResourceBase.
Definition at line 310 of file DirectX12Buffer.cpp.
|
static |
Definition at line 453 of file DirectX12Buffer.cpp.
|
inline |
Definition at line 48 of file DirectX12Buffer.hpp.
|
inline |
Definition at line 45 of file DirectX12Buffer.hpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 424 of file DirectX12Buffer.cpp.
|
inline |
Definition at line 55 of file DirectX12Buffer.hpp.
|
inline |
Definition at line 56 of file DirectX12Buffer.hpp.
|
inline |
Definition at line 51 of file DirectX12Buffer.hpp.
| bool Sleak::RenderEngine::DirectX12Buffer::Initialize | ( | const void * | data, |
| size_t | size ) |
Creates the buffer sized and pre-populated from a raw payload.
Definition at line 126 of file DirectX12Buffer.cpp.
|
overridevirtual |
Creates the default-heap resource and uploads initial data via a staging buffer, if any.
Implements Sleak::ResourceBase.
Definition at line 122 of file DirectX12Buffer.cpp.
|
inline |
Definition at line 54 of file DirectX12Buffer.hpp.
|
overridevirtual |
Maps the buffer for CPU writes (upload-heap buffers only).
Implements Sleak::RenderEngine::BufferBase.
Definition at line 336 of file DirectX12Buffer.cpp.
|
delete |
|
noexcept |
Definition at line 47 of file DirectX12Buffer.cpp.
|
static |
Definition at line 458 of file DirectX12Buffer.cpp.
| void Sleak::RenderEngine::DirectX12Buffer::ReleaseUploadResources | ( | ) |
Definition at line 330 of file DirectX12Buffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 357 of file DirectX12Buffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 284 of file DirectX12Buffer.cpp.
|
overridevirtual |
Overwrites buffer contents via a fresh upload-heap copy.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 367 of file DirectX12Buffer.cpp.