DX12Buffer.h 822 B

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