DX12Buffer.h 914 B

1234567891011121314151617181920212223242526272829
  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. D3D12_HEAP_TYPE heapType = D3D12_HEAP_TYPE_DEFAULT);
  23. //! Returns the buffer
  24. DLLEXPORT ID3D12Resource* zBuffer() const;
  25. };
  26. } // namespace Framework