feat(RHI): 实现 RHICommandQueue 抽象基类

This commit is contained in:
2026-03-17 17:54:44 +08:00
parent 14fb51e61e
commit 4638539f17
6 changed files with 181 additions and 17 deletions

View File

@@ -36,13 +36,17 @@ void D3D12CommandQueue::Shutdown() {
m_commandQueue.Reset();
}
void D3D12CommandQueue::ExecuteCommandLists(uint32_t count, ID3D12CommandList** lists) {
void D3D12CommandQueue::ExecuteCommandLists(uint32_t count, void** lists) {
ExecuteCommandListsInternal(count, reinterpret_cast<ID3D12CommandList**>(lists));
}
void D3D12CommandQueue::ExecuteCommandListsInternal(uint32_t count, ID3D12CommandList** lists) {
m_commandQueue->ExecuteCommandLists(count, lists);
}
void D3D12CommandQueue::Signal(D3D12Fence* fence, uint64_t value) {
void D3D12CommandQueue::Signal(RHIFence* fence, uint64_t value) {
if (fence) {
m_commandQueue->Signal(fence->GetFence(), value);
m_commandQueue->Signal(static_cast<D3D12Fence*>(fence)->GetFence(), value);
}
}
@@ -52,9 +56,9 @@ void D3D12CommandQueue::Signal(ID3D12Fence* fence, uint64_t value) {
}
}
void D3D12CommandQueue::Wait(D3D12Fence* fence, uint64_t value) {
void D3D12CommandQueue::Wait(RHIFence* fence, uint64_t value) {
if (fence) {
m_commandQueue->Wait(fence->GetFence(), value);
m_commandQueue->Wait(static_cast<D3D12Fence*>(fence)->GetFence(), value);
}
}

View File

@@ -0,0 +1,33 @@
#include "XCEngine/RHI/OpenGL/OpenGLCommandQueue.h"
namespace XCEngine {
namespace RHI {
OpenGLCommandQueue::OpenGLCommandQueue() {
}
OpenGLCommandQueue::~OpenGLCommandQueue() {
Shutdown();
}
void OpenGLCommandQueue::Shutdown() {
}
void OpenGLCommandQueue::ExecuteCommandLists(uint32_t count, void** lists) {
}
void OpenGLCommandQueue::Signal(RHIFence* fence, uint64_t value) {
}
void OpenGLCommandQueue::Wait(RHIFence* fence, uint64_t value) {
}
uint64_t OpenGLCommandQueue::GetCompletedValue() {
return 0;
}
void OpenGLCommandQueue::WaitForIdle() {
}
} // namespace RHI
} // namespace XCEngine