BRE12
LightingPass.h
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 #include <wrl.h>
6 
7 #include <EnvironmentLightPass\EnvironmentLightPass.h>
8 #include <CommandManager\CommandListPerFrame.h>
9 
10 struct D3D12_CPU_DESCRIPTOR_HANDLE;
11 
12 struct ID3D12Resource;
13 
14 namespace BRE {
15 struct FrameCBuffer;
16 
17 // Pass responsible to execute recorders related with deferred shading lighting pass
18 class LightingPass {
19 public:
20  LightingPass() = default;
21  ~LightingPass() = default;
22  LightingPass(const LightingPass&) = delete;
23  const LightingPass& operator=(const LightingPass&) = delete;
24  LightingPass(LightingPass&&) = delete;
25  LightingPass& operator=(LightingPass&&) = delete;
26 
27  // Preconditions:
28  // - "geometryBuffers" must not be nullptr
29  // - "geometryBuffersCount" must be greater than zero
30  void Init(ID3D12Resource& baseColorMetalMaskBuffer,
31  ID3D12Resource& normalSmoothnessBuffer,
32  ID3D12Resource& depthBuffer,
33  ID3D12Resource& diffuseIrradianceCubeMap,
34  ID3D12Resource& specularPreConvolvedCubeMap,
35  const D3D12_CPU_DESCRIPTOR_HANDLE& renderTargetView) noexcept;
36 
37  // Preconditions:
38  // - Init() must be called first
39  void Execute(const FrameCBuffer& frameCBuffer) noexcept;
40 
41 private:
42  // Method used internally for validation purposes
43  bool IsDataValid() const noexcept;
44 
45  void ExecuteBeginTask() noexcept;
46  void ExecuteFinalTask() noexcept;
47 
48  CommandListPerFrame mBeginCommandListPerFrame;
49  CommandListPerFrame mFinalCommandListPerFrame;
50 
51  // Geometry buffers created by GeometryPass
52  Microsoft::WRL::ComPtr<ID3D12Resource>* mGeometryBuffers;
53 
54  ID3D12Resource* mBaseColorMetalMaskBuffer{ nullptr };
55  ID3D12Resource* mNormalSmoothnessBuffer{ nullptr };
56  ID3D12Resource* mDepthBuffer{ nullptr };
57 
58  D3D12_CPU_DESCRIPTOR_HANDLE mRenderTargetView{ 0UL };
59 
60  EnvironmentLightPass mEnvironmentLightPass;
61 };
62 
63 }
64 
Definition: Camera.cpp:8
Definition: LightingPass.h:18
Definition: CBuffers.h:23
Definition: CommandListPerFrame.h:16
Definition: EnvironmentLightPass.h:16