Move D3D12 cpp files to src/RHI/D3D12/ subdirectory

This commit is contained in:
2026-03-15 20:50:06 +08:00
parent 4af4326767
commit dfbd218435
21 changed files with 20 additions and 20 deletions

View File

@@ -0,0 +1,41 @@
#include "XCEngine/RHI/D3D12/D3D12RootSignature.h"
namespace XCEngine {
namespace RHI {
D3D12RootSignature::D3D12RootSignature() {
}
D3D12RootSignature::~D3D12RootSignature() {
Shutdown();
}
bool D3D12RootSignature::Initialize(ID3D12Device* device, const D3D12_ROOT_SIGNATURE_DESC& desc) {
ID3DBlob* signature = nullptr;
ID3DBlob* error = nullptr;
HRESULT hResult = D3D12SerializeRootSignature(&desc, D3D_ROOT_SIGNATURE_VERSION_1, &signature, &error);
if (FAILED(hResult)) {
if (error) {
error->Release();
}
return false;
}
hResult = device->CreateRootSignature(0, signature->GetBufferPointer(), signature->GetBufferSize(), IID_PPV_ARGS(&m_rootSignature));
signature->Release();
if (FAILED(hResult)) {
return false;
}
return true;
}
void D3D12RootSignature::Shutdown() {
m_rootSignature.Reset();
}
} // namespace RHI
} // namespace XCEngine