.. _program_listing_file_Source_Azura_RenderSystem_Inc_D3D12_D3D12ScopedPipeline.h: Program Listing for File D3D12ScopedPipeline.h ============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``Source\Azura\RenderSystem\Inc\D3D12\D3D12ScopedPipeline.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include "Log/Log.h" #include "Generic/GenericTypes.h" #include "Memory/Allocator.h" #include "D3D12/D3D12ScopedShader.h" #include "D3D12/D3D12ScopedRenderPass.h" #include "D3D12/D3D12ScopedComputePass.h" #include namespace Azura { namespace D3D12 { class D3D12ScopedPipeline { public: D3D12ScopedPipeline(const Microsoft::WRL::ComPtr& device, D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc, const Log& log); D3D12ScopedPipeline(const Microsoft::WRL::ComPtr& device, D3D12_COMPUTE_PIPELINE_STATE_DESC psoDesc, const Log& log); ID3D12PipelineState* GetState() const; PipelineType GetType() const; private: PipelineType m_type; Microsoft::WRL::ComPtr m_pipeline; }; class D3D12PipelineFactory { public: D3D12PipelineFactory(Memory::Allocator& allocator, Log logger); D3D12PipelineFactory & SetPipelineType(PipelineType type); D3D12PipelineFactory& BulkAddAttributeDescription(const VertexSlot& vertexSlot, U32 binding); D3D12PipelineFactory & SetRasterizerStage(CullMode cullMode, FrontFace faceOrder); D3D12PipelineFactory& AddShaderStage(const D3D12ScopedShader& shader); void Submit(const Microsoft::WRL::ComPtr& device, const Containers::Vector>& renderPasses, Containers::Vector& resultPipelines) const; void Submit(const Microsoft::WRL::ComPtr& device, const Containers::Vector>& computePasses, Containers::Vector& resultPipelines) const; private: const Log log_D3D12RenderSystem; PipelineType m_type; struct BindingInfo { U32 m_offset{0}; }; // TODO(vasumahesh1): Make our own map std::map m_bindingMap; D3D12_RASTERIZER_DESC m_rasterizerDesc{CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT)}; Containers::Vector m_inputElementDescs; std::optional m_vertexShaderModule; std::optional m_pixelShaderModule; std::optional m_computeShaderModule; }; } // namespace D3D12 } // namespace Azura