27 lines
593 B
C++
27 lines
593 B
C++
|
|
#include "XCEngine/RHI/D3D12/D3D12PipelineState.h"
|
||
|
|
|
||
|
|
namespace XCEngine {
|
||
|
|
namespace RHI {
|
||
|
|
|
||
|
|
D3D12PipelineState::D3D12PipelineState() {
|
||
|
|
}
|
||
|
|
|
||
|
|
D3D12PipelineState::~D3D12PipelineState() {
|
||
|
|
Shutdown();
|
||
|
|
}
|
||
|
|
|
||
|
|
bool D3D12PipelineState::Initialize(ID3D12Device* device, const D3D12_GRAPHICS_PIPELINE_STATE_DESC& desc) {
|
||
|
|
HRESULT hResult = device->CreateGraphicsPipelineState(&desc, IID_PPV_ARGS(&m_pipelineState));
|
||
|
|
if (FAILED(hResult)) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
void D3D12PipelineState::Shutdown() {
|
||
|
|
m_pipelineState.Reset();
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace RHI
|
||
|
|
} // namespace XCEngine
|