Files
XCEngine/engine/include/XCEngine/RHI/D3D12/D3D12CommandQueue.h
ssdfasd 0ce312e648 Remove RHI interface inheritance from all D3D12 backend classes
- 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)
2026-03-16 15:48:14 +08:00

47 lines
1.2 KiB
C++

#pragma once
#include <d3d12.h>
#include <wrl/client.h>
#include "../Enums.h"
#include "../CommandQueue.h"
#include "D3D12Enum.h"
using Microsoft::WRL::ComPtr;
namespace XCEngine {
namespace RHI {
class D3D12Fence;
class D3D12CommandQueue {
public:
D3D12CommandQueue();
~D3D12CommandQueue();
bool Initialize(ID3D12Device* device, CommandQueueType type = CommandQueueType::Direct);
void Shutdown();
void ExecuteCommandLists(uint32_t count, ICommandList** lists);
void ExecuteCommandLists(uint32_t count, ID3D12CommandList** lists);
void Signal(IFence* fence, uint64_t value);
void Signal(ID3D12Fence* fence, uint64_t value);
void Wait(IFence* fence, uint64_t value);
void Wait(ID3D12Fence* fence, uint64_t value);
uint64_t GetCompletedValue();
void WaitForIdle();
CommandQueueType GetType() const { return m_type; }
uint64_t GetTimestampFrequency() const { return m_timestampFrequency; }
ID3D12CommandQueue* GetCommandQueue() const { return m_commandQueue.Get(); }
private:
ComPtr<ID3D12CommandQueue> m_commandQueue;
CommandQueueType m_type;
uint64_t m_timestampFrequency;
};
} // namespace RHI
} // namespace XCEngine