#pragma once #include #include "DXBuffer.h" namespace Framework { class DX12CommandQueue; //! A buffer with data in graphics memory class DX12Buffer : public DXBuffer { protected: D3D12_RESOURCE_DESC* description; ID3D12Resource* buffer; ID3D12Device5* zDevice; DX12CommandQueue* queue; public: //! Constructor //! eSize: The length of an element in bytes DLLEXPORT DX12Buffer(int eSize, ID3D12Device5* zDevice, DX12CommandQueue* queue, int bindFlags); //! Destructor DLLEXPORT virtual ~DX12Buffer(); //! Copies the data into the buffer if it has changed DLLEXPORT virtual void copyToGPU(__int64 byteCount = -1) override; DLLEXPORT void createBufferWithoutData(D3D12_RESOURCE_STATES states, D3D12_HEAP_TYPE heapType = D3D12_HEAP_TYPE_DEFAULT); //! Returns the buffer DLLEXPORT ID3D12Resource* zBuffer() const; }; } // namespace Framework