| 38 | { |
| 39 | |
| 40 | ComputeStateObject::ComputeStateObject(ref<Device> pDevice, ComputeStateObjectDesc desc) |
| 41 | : mpDevice(std::move(pDevice)), mDesc(std::move(desc)) |
| 42 | { |
| 43 | gfx::ComputePipelineStateDesc computePipelineDesc = {}; |
| 44 | computePipelineDesc.program = mDesc.pProgramKernels->getGfxProgram(); |
| 45 | #if FALCOR_HAS_D3D12 |
| 46 | if (mDesc.pD3D12RootSignatureOverride) |
| 47 | mpDevice->requireD3D12(); |
| 48 | if (mpDevice->getType() == Device::Type::D3D12) |
| 49 | { |
| 50 | computePipelineDesc.d3d12RootSignatureOverride = |
| 51 | mDesc.pD3D12RootSignatureOverride ? (void*)mDesc.pD3D12RootSignatureOverride->getApiHandle().GetInterfacePtr() : nullptr; |
| 52 | } |
| 53 | #endif |
| 54 | FALCOR_GFX_CALL(mpDevice->getGfxDevice()->createComputePipelineState(computePipelineDesc, mGfxPipelineState.writeRef())); |
| 55 | } |
| 56 | |
| 57 | ComputeStateObject::~ComputeStateObject() |
| 58 | { |
nothing calls this directly
no test coverage detected