DXCommandQueue.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "Betriebssystem.h"
  3. #include "ReferenceCounter.h"
  4. //! DirectX12 Datentypen
  5. struct ID3D12CommandAllocator;
  6. struct ID3D12CommandQueue;
  7. struct ID3D12Fence;
  8. struct ID3D12Device2;
  9. struct ID3D12GraphicsCommandList2;
  10. namespace Framework
  11. {
  12. class DX12Command;
  13. class DX12CommandQueue : public virtual ReferenceCounter
  14. {
  15. protected:
  16. ID3D12CommandAllocator *allocator;
  17. ID3D12GraphicsCommandList2 *commandList;
  18. ID3D12CommandQueue *queue;
  19. ID3D12Fence *fence;
  20. ID3D12Device2 *device;
  21. HANDLE event;
  22. unsigned __int64 fenceValue;
  23. DX12CommandQueue( int typ, ID3D12Device2 *device );
  24. public:
  25. virtual ~DX12CommandQueue();
  26. unsigned __int64 addSignalFromGPU();
  27. void whaitForGPUSignal();
  28. void whaitForGPUSignal( unsigned __int64 value );
  29. void flush();
  30. ID3D12CommandAllocator *getAllocator() const;
  31. ID3D12GraphicsCommandList2 *getCommandList() const;
  32. ID3D12CommandQueue *getQueue() const;
  33. void execute();
  34. };
  35. class DX12DirectCommandQueue : public DX12CommandQueue
  36. {
  37. public:
  38. DX12DirectCommandQueue( ID3D12Device2 *device );
  39. };
  40. class DX12CopyCommandQueue : public DX12CommandQueue
  41. {
  42. public:
  43. DX12CopyCommandQueue( ID3D12Device2 *device );
  44. };
  45. class DX12ComputeCommandQueue : public DX12CommandQueue
  46. {
  47. public:
  48. DX12ComputeCommandQueue( ID3D12Device2 *device );
  49. };
  50. };