Move D3D12 cpp files to src/RHI/D3D12/ subdirectory
This commit is contained in:
36
engine/src/RHI/D3D12/D3D12CommandAllocator.cpp
Normal file
36
engine/src/RHI/D3D12/D3D12CommandAllocator.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "XCEngine/RHI/D3D12/D3D12CommandAllocator.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12Enum.h"
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
D3D12CommandAllocator::D3D12CommandAllocator()
|
||||
: m_type(CommandQueueType::Direct) {
|
||||
}
|
||||
|
||||
D3D12CommandAllocator::~D3D12CommandAllocator() {
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
bool D3D12CommandAllocator::Initialize(ID3D12Device* device, CommandQueueType type) {
|
||||
m_type = type;
|
||||
HRESULT hResult = device->CreateCommandAllocator(
|
||||
ToD3D12(type),
|
||||
IID_PPV_ARGS(&m_commandAllocator));
|
||||
return SUCCEEDED(hResult);
|
||||
}
|
||||
|
||||
void D3D12CommandAllocator::Shutdown() {
|
||||
m_commandAllocator.Reset();
|
||||
}
|
||||
|
||||
void D3D12CommandAllocator::Reset() {
|
||||
m_commandAllocator->Reset();
|
||||
}
|
||||
|
||||
bool D3D12CommandAllocator::IsReady() const {
|
||||
return m_commandAllocator != nullptr;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user