DX12Texture.h 998 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "Texture.h"
  3. struct ID3D12Device;
  4. struct D3D12_RESOURCE_DESC;
  5. struct ID3D12Resource;
  6. struct ID3D12GraphicsCommandList;
  7. namespace Framework
  8. {
  9. class DX12Texture : public Texture
  10. {
  11. private:
  12. ID3D12Resource* buffer;
  13. ID3D12Resource* intermediate;
  14. ID3D12Device* device;
  15. DX12CopyCommandQueue* copy;
  16. DX12DirectCommandQueue* direct;
  17. bool shaderResource;
  18. public:
  19. DLLEXPORT DX12Texture(ID3D12Device* device,
  20. DX12CopyCommandQueue* copy,
  21. DX12DirectCommandQueue* direct);
  22. DLLEXPORT ~DX12Texture();
  23. //! Updates the texture. The pixels of the current image are copied
  24. //! to graphics memory
  25. DLLEXPORT bool updateTextur() override;
  26. //! Returns true if updateTextur needs to be called
  27. DLLEXPORT bool needsUpdate() const override;
  28. //! Returns the DX12 resource
  29. DLLEXPORT ID3D12Resource* getResource();
  30. };
  31. } // namespace Framework