# Juliet\src\Graphics\D3D12\D3D12Buffer ## Source Files - Header: `Juliet\src\Graphics\D3D12\D3D12Buffer.h` - Source: `Juliet\src\Graphics\D3D12\D3D12Buffer.cpp` ## AI Description The `D3D12Buffer` class in the provided C++ component is designed to manage DirectX 12 buffers efficiently. It encapsulates various aspects of buffer creation, management, and operations such as mapping, unmapping, copying, and transitioning between states. The class uses a bindless descriptor heap for constant buffers and structured buffers, which allows for efficient resource management and access. The `CreateGraphicsBuffer` function is used to create a base buffer, while the `CreateGraphicsTransferBuffer` function creates transfer buffers for upload and download operations. The `DestroyGraphicsBuffer` function ensures proper cleanup of resources when they are no longer needed. ## Symbols ### Namespace `Juliet::D3D12` #### Classes, Structs & Unions - `struct D3D12Buffer` #### Functions & Methods - `extern GraphicsBuffer* CreateGraphicsBuffer(NonNullPtr driver, size_t size, size_t stride, BufferUsage usage, bool isDynamic)` - `extern void DestroyGraphicsBuffer(NonNullPtr buffer)` - `extern GraphicsTransferBuffer* CreateGraphicsTransferBuffer(NonNullPtr driver, size_t size, TransferBufferUsage usage)` - `extern void DestroyGraphicsTransferBuffer(NonNullPtr buffer)` - `extern void* MapBuffer(NonNullPtr driver, NonNullPtr buffer)` - `extern void UnmapBuffer(NonNullPtr driver, NonNullPtr buffer)` - `extern uint32 GetDescriptorIndex(NonNullPtr driver, NonNullPtr buffer)` - `extern void CopyBuffer(NonNullPtr commandList, NonNullPtr dst, NonNullPtr src, size_t size, size_t dstOffset, size_t srcOffset)` - `extern void TransitionBufferToReadable(NonNullPtr commandList, NonNullPtr buffer)`