2022-02-06 10:56:57 +01:00
|
|
|
// Copyright (C) 2021-2022, Dmitry Maluev (dmaluev@gmail.com). All rights reserved.
|
2019-04-03 00:02:02 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-08-12 13:43:56 +02:00
|
|
|
namespace verus::CGI
|
2019-04-03 00:02:02 +02:00
|
|
|
{
|
2023-08-12 13:43:56 +02:00
|
|
|
class PipelineD3D12 : public BasePipeline
|
2019-04-03 00:02:02 +02:00
|
|
|
{
|
2023-08-12 13:43:56 +02:00
|
|
|
ComPtr<ID3D12PipelineState> _pPipelineState;
|
|
|
|
ID3D12RootSignature* _pRootSignature = nullptr;
|
|
|
|
D3D_PRIMITIVE_TOPOLOGY _topology = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
|
|
|
bool _compute = false;
|
2019-04-03 00:02:02 +02:00
|
|
|
|
2023-08-12 13:43:56 +02:00
|
|
|
public:
|
|
|
|
PipelineD3D12();
|
|
|
|
virtual ~PipelineD3D12() override;
|
2019-04-03 00:02:02 +02:00
|
|
|
|
2023-08-12 13:43:56 +02:00
|
|
|
virtual void Init(RcPipelineDesc desc) override;
|
|
|
|
virtual void Done() override;
|
2019-06-02 22:42:07 +02:00
|
|
|
|
2023-08-12 13:43:56 +02:00
|
|
|
//
|
|
|
|
// D3D12
|
|
|
|
//
|
2019-06-02 22:42:07 +02:00
|
|
|
|
2023-08-12 13:43:56 +02:00
|
|
|
VERUS_P(void InitCompute(RcPipelineDesc desc));
|
|
|
|
VERUS_P(void InitMeshShading(RcPipelineDesc desc));
|
|
|
|
D3D12_SHADER_BYTECODE ToBytecode(ID3DBlob* pBlob);
|
|
|
|
bool IsCompute() const { return _compute; }
|
|
|
|
ID3D12PipelineState* GetD3DPipelineState() const { return _pPipelineState.Get(); }
|
|
|
|
ID3D12RootSignature* GetD3DRootSignature() const { return _pRootSignature; }
|
|
|
|
D3D_PRIMITIVE_TOPOLOGY GetD3DPrimitiveTopology() const { return _topology; }
|
|
|
|
void FillBlendStateRenderTargets(RcPipelineDesc desc, int attachmentCount, D3D12_BLEND_DESC& blendDesc);
|
|
|
|
};
|
|
|
|
VERUS_TYPEDEFS(PipelineD3D12);
|
2019-04-03 00:02:02 +02:00
|
|
|
}
|