- D3D12Device, D3D12CommandQueue, D3D12CommandAllocator, D3D12Fence - D3D12DescriptorHeap, D3D12QueryHeap, D3D12RootSignature - D3D12PipelineState, D3D12Sampler, D3D12Shader - D3D12Buffer, D3D12Texture, D3D12SwapChain All D3D12 backend classes now directly use D3D12 APIs without going through RHI interface abstraction. This decouples the D3D12 backend from the RHI abstraction layer. Test: D3D12 rendering test passed (screenshot comparison 100% match)
34 lines
675 B
C++
34 lines
675 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:
|
|
D3D12CommandAllocator();
|
|
~D3D12CommandAllocator();
|
|
|
|
bool Initialize(ID3D12Device* device, CommandQueueType type = CommandQueueType::Direct);
|
|
void Shutdown();
|
|
|
|
void Reset();
|
|
bool IsReady() const;
|
|
|
|
ID3D12CommandAllocator* GetCommandAllocator() const { return m_commandAllocator.Get(); }
|
|
|
|
private:
|
|
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
|
|
CommandQueueType m_type;
|
|
};
|
|
|
|
} // namespace RHI
|
|
} // namespace XCEngine
|