1#ifndef DIRECTX11BUFFER_HPP_
2#define DIRECTX11BUFFER_HPP_
21 UINT bindFlags, UINT cpuAccessFlags);
40 void Unmap() override;
42 void Update(
void* data,
size_t size) override;
45 bool Initialize(const
void* data, uint16_t size);
53 bool IsValid()
const {
return m_buffer !=
nullptr; }
54 D3D11_USAGE
GetUsage()
const {
return m_usage; }
60 D3D11_BUFFER_DESC CreateBufferDesc()
const;
66 Microsoft::WRL::ComPtr<ID3D11Device> m_device;
67 Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_deviceContext;
68 Microsoft::WRL::ComPtr<ID3D11Buffer> m_buffer;
70 D3D11_USAGE m_usage = D3D11_USAGE_DEFAULT;
72 UINT m_cpuAccessFlags = 0;
73 D3D11_MAPPED_SUBRESOURCE m_mappedResource = {};
Backend-agnostic GPU buffer: vertex, index, constant, or resource view target.
UINT GetCPUAccessFlags() const
void * GetData() override
Returns CPU-visible data directly for readable buffers, or round-trips GPU-only buffers through a sta...
DirectX11Buffer(const DirectX11Buffer &)=delete
bool Map() override
Maps the buffer for CPU writes (dynamic usage only).
DirectX11Buffer & operator=(const DirectX11Buffer &)=delete
DirectX11Buffer(ID3D11Device *device, size_t size, BufferType type)
Derives usage/bind/CPU-access flags from the buffer type via ConfigureFromBufferType.
bool Initialize(void *Data) override
Creates the D3D11 buffer resource and uploads initial data, if any.
D3D11_USAGE GetUsage() const
UINT GetBindFlags() const
ID3D11Buffer * GetD3DBuffer() const
Backend-facing rendering layer shared by the four graphics backends.
BufferType
GPU buffer usage kind, drives backend binding flags and layout.
Root namespace for everything the engine exposes.