BRE12
EnvironmentLightCmdListRecorder.h
1 #pragma once
2 
3 #include <wrl.h>
4 
5 #include <CommandManager\CommandListPerFrame.h>
6 #include <ResourceManager\FrameUploadCBufferPerFrame.h>
7 
8 struct D3D12_CPU_DESCRIPTOR_HANDLE;
9 struct ID3D12Resource;
10 
11 namespace BRE {
12 struct FrameCBuffer;
13 
14 // Responsible of command lists recording to be executed by CommandListExecutor.
15 // This class has common data and functionality to record command list for environment light pass.
17 public:
21  const EnvironmentLightCmdListRecorder& operator=(const EnvironmentLightCmdListRecorder&) = delete;
24 
25  static void InitSharedPSOAndRootSignature() noexcept;
26 
27  // Preconditions:
28  // - InitSharedPSOAndRootSignature() must be called first and once
29  void Init(ID3D12Resource& normalSmoothnessBuffer,
30  ID3D12Resource& baseColorMetalMaskBuffer,
31  ID3D12Resource& depthBuffer,
32  ID3D12Resource& diffuseIrradianceCubeMap,
33  ID3D12Resource& specularPreConvolvedCubeMap,
34  ID3D12Resource& ambientAccessibilityBuffer,
35  const D3D12_CPU_DESCRIPTOR_HANDLE& renderTargetView) noexcept;
36 
37  // Preconditions:
38  // - Init() must be called first
39  void RecordAndPushCommandLists(const FrameCBuffer& frameCBuffer) noexcept;
40 
41  bool ValidateData() const noexcept;
42 
43 private:
44  void InitShaderResourceViews(ID3D12Resource& normalSmoothnessBuffer,
45  ID3D12Resource& baseColorMetalMaskBuffer,
46  ID3D12Resource& depthBuffer,
47  ID3D12Resource& diffuseIrradianceCubeMap,
48  ID3D12Resource& ambientAccessibilityBuffer,
49  ID3D12Resource& specularPreConvolvedCubeMap) noexcept;
50 
51  CommandListPerFrame mCommandListPerFrame;
52 
53  FrameUploadCBufferPerFrame mFrameUploadCBufferPerFrame;
54 
55  D3D12_CPU_DESCRIPTOR_HANDLE mRenderTargetView{ 0UL };
56 
57  D3D12_GPU_DESCRIPTOR_HANDLE mStartPixelShaderResourceView{ 0UL };
58 };
59 }
60 
Definition: Camera.cpp:8
Definition: EnvironmentLightCmdListRecorder.h:16
Definition: FrameUploadCBufferPerFrame.h:11
Definition: CBuffers.h:23
Definition: CommandListPerFrame.h:16