.. _program_listing_file_Source_Azura_RenderSystem_Inc_D3D12_D3D12ScopedRenderPass.h: Program Listing for File D3D12ScopedRenderPass.h ================================================ |exhale_lsh| :ref:`Return to documentation for file ` (``Source\Azura\RenderSystem\Inc\D3D12\D3D12ScopedRenderPass.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "Types.h" #include "Log/Log.h" #include "D3D12/D3D12Core.h" #include "D3D12/D3D12ScopedImage.h" #include "D3D12/D3D12ScopedShader.h" #include "D3D12/D3D12ScopedCommandBuffer.h" #include "D3D12/D3D12ScopedSwapChain.h" namespace Azura { namespace Memory { class Allocator; } } namespace Azura { namespace D3D12 { struct D3D12RenderOutputInfo { RawStorageFormat m_format; }; class D3D12ScopedRenderPass { public: D3D12ScopedRenderPass(U32 idx, U32 internalId, const D3D12ScopedSwapChain& swapChain, Memory::Allocator& mainAllocator, Log logger); void Create(const Microsoft::WRL::ComPtr& device, const PipelinePassCreateInfo& createInfo, const Containers::Vector& pipelineBuffers, const Containers::Vector& pipelineBufferImages, const Containers::Vector& descriptorSlots, const Containers::Vector& descriptorSetTable, const Containers::Vector& allShaders, UINT rtvDescriptorSize, UINT dsvDescriptorSize); void CreateForSwapChain(const Microsoft::WRL::ComPtr& device, const PipelinePassCreateInfo& createInfo, const Containers::Vector& pipelineBuffers, const Containers::Vector& pipelineBufferImages, const D3D12ScopedImage& depthImage, const Containers::Vector& descriptorSlots, const Containers::Vector& descriptorSetTable, const Containers::Vector& allShaders, UINT rtvDescriptorSize, UINT dsvDescriptorSize); U32 GetId() const; U32 GetInternalId() const; ID3D12GraphicsCommandList* GetPrimaryGraphicsCommandList(U32 idx) const; const DescriptorCount& GetDescriptorCount() const; ID3D12RootSignature* GetRootSignature() const; void RecordImageAcquireBarrier(ID3D12GraphicsCommandList* commandList, U32 idx) const; void RecordPresentBarrier(ID3D12GraphicsCommandList* commandList, U32 idx) const; void SetRenderTargets(ID3D12GraphicsCommandList* commandList, U32 cBufferIdx, UINT rtvDescriptorSize) const; const Containers::Vector>& GetShaders() const; const Containers::Vector>& GetInputInfo() const; const Containers::Vector>& GetInputImages() const; const Containers::Vector& GetRootSignatureTable() const; void RecordResourceBarriersForOutputsStart(ID3D12GraphicsCommandList* commandList) const; void RecordResourceBarriersForOutputsEnd(ID3D12GraphicsCommandList* commandList) const; void RecordResourceBarriersForInputsStart(ID3D12GraphicsCommandList* commandList) const; void RecordResourceBarriersForInputsEnd(ID3D12GraphicsCommandList* commandList) const; void RecordResourceBarriersForWritingInputs(ID3D12GraphicsCommandList * commandList) const; void WaitForGPU(ID3D12CommandQueue* commandQueue); U32 GetCommandBufferCount() const; void UpdatePipelineInfo(D3D12_GRAPHICS_PIPELINE_STATE_DESC& psoDesc); private: void CreateBase( const Microsoft::WRL::ComPtr& device, const PipelinePassCreateInfo& createInfo, const Containers::Vector& descriptorSlots, const Containers::Vector& descriptorSetTable, const Containers::Vector& pipelineBuffers, const Containers::Vector& pipelineBufferImages, const Containers::Vector& allShaders); void ApplyBlendToPSO(D3D12_GRAPHICS_PIPELINE_STATE_DESC & psoDesc, U32 id) const; const Log log_D3D12RenderSystem; U32 m_id; U32 m_internalId; bool m_hasDepth{false}; bool m_isTargetSwapChain{false}; std::reference_wrapper m_swapChainRef; Containers::Vector m_rootSignatureTable; Containers::Vector m_renderOutputInfo; Containers::Vector> m_passShaders; Containers::Vector> m_passInputs; SmallVector m_commandBuffers; SmallVector m_swapChainImageResources; SmallVector, MAX_RENDER_PASS_OUTPUTS> m_renderOutputs; SmallVector, MAX_RENDER_PASS_OUTPUTS> m_renderInputs; SmallVector, MAX_RENDER_PASS_OUTPUTS> m_depthOutputs; SmallVector, MAX_RENDER_PASS_OUTPUTS> m_depthInputs; Containers::Vector> m_allRenderInputs; Microsoft::WRL::ComPtr m_rtvHeap; Microsoft::WRL::ComPtr m_dsvHeap; Microsoft::WRL::ComPtr m_rootSignature; DescriptorCount m_descriptorCount{}; ClearData m_clearData; U32 m_fenceValue{1}; HANDLE m_fenceEvent{}; Microsoft::WRL::ComPtr m_signalFence; SmallVector, MAX_RENDER_PASS_INPUTS> m_waitFences; BlendState m_blendState; }; } // namespace D3D12 } // namespace Azura