DX12Buffer.h 850 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <d3d12.h>
  3. #include "DXBuffer.h"
  4. namespace Framework
  5. {
  6. //! A buffer with data in graphics memory
  7. class DX12Buffer : public DXBuffer
  8. {
  9. protected:
  10. D3D12_RESOURCE_DESC* description;
  11. ID3D12Resource* buffer;
  12. ID3D12Device5* device;
  13. public:
  14. //! Constructor
  15. //! eSize: The length of an element in bytes
  16. DLLEXPORT DX12Buffer(int eSize, ID3D12Device5* device, int bindFlags);
  17. //! Destructor
  18. DLLEXPORT virtual ~DX12Buffer();
  19. //! Copies the data into the buffer if it has changed
  20. DLLEXPORT virtual void copyToGPU(__int64 byteCount = -1) override;
  21. DLLEXPORT void createBufferWithoutData(D3D12_RESOURCE_STATES states);
  22. //! Returns the buffer
  23. DLLEXPORT ID3D12Resource* zBuffer() const;
  24. };
  25. } // namespace Framework