BRE12
SkyBoxCmdListRecorder.h
1 #pragma once
2 
3 #include <DirectXMath.h>
4 
5 #include <CommandManager\CommandListPerFrame.h>
6 #include <MathUtils\MathUtils.h>
7 #include <ResourceManager\FrameUploadCBufferPerFrame.h>
8 #include <ResourceManager/VertexAndIndexBufferCreator.h>
9 
10 struct D3D12_CPU_DESCRIPTOR_HANDLE;
11 struct D3D12_GPU_DESCRIPTOR_HANDLE;
12 struct ID3D12CommandAllocator;
13 struct ID3D12Resource;
14 struct ID3D12GraphicsCommandList;
15 
16 namespace BRE {
17 struct FrameCBuffer;
18 
20 public:
21  SkyBoxCmdListRecorder() = default;
22  ~SkyBoxCmdListRecorder() = default;
24  const SkyBoxCmdListRecorder& operator=(const SkyBoxCmdListRecorder&) = delete;
26  SkyBoxCmdListRecorder& operator=(SkyBoxCmdListRecorder&&) = delete;
27 
28  static void InitSharedPSOAndRootSignature() noexcept;
29 
30  // Preconditions:
31  // - InitSharedPSOAndRootSignature() must be called first and once
32  void Init(const VertexAndIndexBufferCreator::VertexBufferData& vertexBufferData,
34  const DirectX::XMFLOAT4X4& worldMatrix,
35  ID3D12Resource& skyBoxCubeMap,
36  const D3D12_CPU_DESCRIPTOR_HANDLE& renderTargetView,
37  const D3D12_CPU_DESCRIPTOR_HANDLE& depthBufferView) noexcept;
38 
39  // Preconditions:
40  // - Init() must be called first
41  void RecordAndPushCommandLists(const FrameCBuffer& frameCBuffer) noexcept;
42 
43  bool IsDataValid() const noexcept;
44 
45 private:
46  void InitConstantBuffers(const DirectX::XMFLOAT4X4& worldMatrix) noexcept;
47  void InitShaderResourceViews(ID3D12Resource& skyBoxCubeMap) noexcept;
48 
49  CommandListPerFrame mCommandListPerFrame;
50 
53 
54  FrameUploadCBufferPerFrame mFrameUploadCBufferPerFrame;
55 
56  UploadBuffer* mObjectUploadCBuffer{ nullptr };
57  D3D12_GPU_DESCRIPTOR_HANDLE mObjectCBufferView;
58 
59  D3D12_GPU_DESCRIPTOR_HANDLE mStartPixelShaderResourceView;
60 
61  D3D12_CPU_DESCRIPTOR_HANDLE mRenderTargetView{ 0UL };
62  D3D12_CPU_DESCRIPTOR_HANDLE mDepthBufferView{ 0UL };
63 };
64 }
65 
Definition: Camera.cpp:8
Definition: VertexAndIndexBufferCreator.h:53
Definition: FrameUploadCBufferPerFrame.h:11
Definition: CBuffers.h:23
Definition: VertexAndIndexBufferCreator.h:36
Definition: CommandListPerFrame.h:16
Definition: UploadBuffer.h:9
Definition: SkyBoxCmdListRecorder.h:19