| 1234567891011121314151617181920212223242526272829 |
- #pragma once
- #include <d3d12.h>
- #include "DXBuffer.h"
- namespace Framework
- {
- //! A buffer with data in graphics memory
- class DX12Buffer : public DXBuffer
- {
- protected:
- D3D12_RESOURCE_DESC* description;
- ID3D12Resource* buffer;
- ID3D12Device5* device;
- public:
- //! Constructor
- //! eSize: The length of an element in bytes
- DLLEXPORT DX12Buffer(int eSize, ID3D12Device5* device, 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
|