7 #include <CommandManager\CommandListPerFrame.h> 8 #include <Camera/Camera.h> 9 #include <GeometryPass\GeometryPass.h> 10 #include <LightingPass\LightingPass.h> 11 #include <PostProcesspass\PostProcesspass.h> 12 #include <SettingsManager\SettingsManager.h> 13 #include <SkyBoxPass\SkyBoxPass.h> 14 #include <ShaderUtils\CBuffers.h> 15 #include <ToneMappingPass\ToneMappingPass.h> 16 #include <Timer/Timer.h> 19 class CommandListExecutor;
38 void Terminate() noexcept;
44 tbb::task* execute()
final override;
48 void InitPasses(
Scene& scene) noexcept;
50 void CreateFrameBuffersAndRenderTargetViews() noexcept;
52 void CreateDepthStencilBufferAndView() noexcept;
54 void CreateIntermediateColorBufferAndRenderTargetView(
const D3D12_RESOURCE_STATES initialState,
55 const wchar_t* resourceName,
56 Microsoft::WRL::ComPtr<ID3D12Resource>& buffer,
57 D3D12_CPU_DESCRIPTOR_HANDLE& renderTargetView) noexcept;
59 ID3D12Resource* CurrentFrameBuffer()
const noexcept
61 BRE_ASSERT(mSwapChain !=
nullptr);
62 return mFrameBuffers[mSwapChain->GetCurrentBackBufferIndex()].Get();
65 D3D12_CPU_DESCRIPTOR_HANDLE CurrentFrameBufferCpuDesc()
const noexcept
67 return mFrameBufferRenderTargetViews[mSwapChain->GetCurrentBackBufferIndex()];
70 D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilCpuDesc()
const noexcept
72 return mDepthBufferRenderTargetView;
75 void ExecuteFinalPass();
77 void FlushCommandQueue() noexcept;
78 void SignalFenceAndPresent() noexcept;
80 Microsoft::WRL::ComPtr<IDXGISwapChain3> mSwapChain{
nullptr };
83 ID3D12Fence* mFence{
nullptr };
84 std::uint32_t mCurrentQueuedFrameIndex{ 0U };
85 std::uint64_t mFenceValueByQueuedFrameIndex[SettingsManager::sQueuedFrameCount]{ 0UL };
86 std::uint64_t mCurrentFenceValue{ 0UL };
97 Microsoft::WRL::ComPtr<ID3D12Resource> mFrameBuffers[SettingsManager::sSwapChainBufferCount];
98 D3D12_CPU_DESCRIPTOR_HANDLE mFrameBufferRenderTargetViews[SettingsManager::sSwapChainBufferCount]{ 0UL };
100 ID3D12Resource* mDepthBuffer{
nullptr };
101 D3D12_CPU_DESCRIPTOR_HANDLE mDepthBufferRenderTargetView{ 0UL };
105 Microsoft::WRL::ComPtr<ID3D12Resource> mIntermediateColorBuffer1;
106 D3D12_CPU_DESCRIPTOR_HANDLE mIntermediateColorBuffer1RenderTargetView;
107 Microsoft::WRL::ComPtr<ID3D12Resource> mIntermediateColorBuffer2;
108 D3D12_CPU_DESCRIPTOR_HANDLE mIntermediateColorBuffer2RenderTargetView;
117 bool mTerminate{
false };
Timer class used mainly to get frame time.
Definition: Timer.h:9
Definition: GeometryPass.h:16
Definition: LightingPass.h:18
Definition: SkyBoxPass.h:14
Definition: PostProcessPass.h:13
Definition: ToneMappingPass.h:12
Definition: CBuffers.h:23
Definition: RenderManager.h:26
Definition: CommandListPerFrame.h:16