34 lines
720 B
C++
34 lines
720 B
C++
#pragma once
|
|
|
|
#include <d3d12.h>
|
|
#include <wrl/client.h>
|
|
|
|
#include "../Enums.h"
|
|
#include "../CommandAllocator.h"
|
|
|
|
using Microsoft::WRL::ComPtr;
|
|
|
|
namespace XCEngine {
|
|
namespace RHI {
|
|
|
|
class D3D12CommandAllocator : public ICommandAllocator {
|
|
public:
|
|
D3D12CommandAllocator();
|
|
~D3D12CommandAllocator();
|
|
|
|
bool Initialize(ID3D12Device* device, CommandQueueType type = CommandQueueType::Direct);
|
|
void Shutdown();
|
|
|
|
void Reset() override;
|
|
bool IsReady() const override;
|
|
|
|
ID3D12CommandAllocator* GetCommandAllocator() const { return m_commandAllocator.Get(); }
|
|
|
|
private:
|
|
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
|
|
CommandQueueType m_type;
|
|
};
|
|
|
|
} // namespace RHI
|
|
} // namespace XCEngine
|