Nameless Engine
Loading...
Searching...
No Matches
DirectXShadowMapArrayIndexManager.h
1#pragma once
2
3// Standard.
4#include <memory>
5#include <mutex>
6
7// Custom.
8#include "render/general/resource/shadow/ShadowMapArrayIndexManager.h"
9#include "render/directx/descriptors/DirectXDescriptorHeap.h"
10
11namespace ne {
12 class ShadowMapHandle;
13 class DirectXResource;
14 class GpuResourceManager;
15
18 public:
20
23
26
28 virtual ~DirectXShadowMapArrayIndexManager() override;
29
39 static std::variant<std::unique_ptr<DirectXShadowMapArrayIndexManager>, Error> create(
41 GpuResourceManager* pResourceManager,
42 const std::string& sShaderArrayResourceName);
43
50
51 protected:
62
74 [[nodiscard]] virtual std::optional<Error>
75 registerShadowMapResource(ShadowMapHandle* pShadowMapHandle) override;
76
84 [[nodiscard]] virtual std::optional<Error>
85 unregisterShadowMapResource(ShadowMapHandle* pShadowMapHandle) override;
86
94 [[nodiscard]] virtual std::optional<Error> bindShadowMapsToPipeline(Pipeline* pPipeline) override;
95
101 [[nodiscard]] virtual std::optional<Error> bindShadowMapsToAllPipelines() override;
102
103 private:
106
112 std::unique_ptr<ContinuousDirectXDescriptorRange> pSrvRange;
113
115 std::pair<std::recursive_mutex, std::unordered_set<ShadowMapHandle*>> mtxRegisteredShadowMaps;
116 };
117}
Definition: DirectXDescriptorHeap.h:44
Definition: DirectXShadowMapArrayIndexManager.h:17
virtual std::optional< Error > bindShadowMapsToAllPipelines() override
Definition: DirectXShadowMapArrayIndexManager.cpp:174
void onSrvRangeIndicesChanged()
Definition: DirectXShadowMapArrayIndexManager.cpp:179
std::pair< std::recursive_mutex, std::unordered_set< ShadowMapHandle * > > mtxRegisteredShadowMaps
Definition: DirectXShadowMapArrayIndexManager.h:115
ContinuousDirectXDescriptorRange * getSrvDescriptorRange() const
Definition: DirectXShadowMapArrayIndexManager.h:49
virtual ~DirectXShadowMapArrayIndexManager() override
Definition: DirectXShadowMapArrayIndexManager.cpp:15
std::unique_ptr< ContinuousDirectXDescriptorRange > pSrvRange
Definition: DirectXShadowMapArrayIndexManager.h:112
virtual std::optional< Error > registerShadowMapResource(ShadowMapHandle *pShadowMapHandle) override
Definition: DirectXShadowMapArrayIndexManager.cpp:65
virtual std::optional< Error > unregisterShadowMapResource(ShadowMapHandle *pShadowMapHandle) override
Definition: DirectXShadowMapArrayIndexManager.cpp:148
static std::variant< std::unique_ptr< DirectXShadowMapArrayIndexManager >, Error > create(Renderer *pRenderer, GpuResourceManager *pResourceManager, const std::string &sShaderArrayResourceName)
Definition: DirectXShadowMapArrayIndexManager.cpp:31
virtual std::optional< Error > bindShadowMapsToPipeline(Pipeline *pPipeline) override
Definition: DirectXShadowMapArrayIndexManager.cpp:169
Definition: Error.h:27
Definition: GpuResourceManager.h:43
Definition: Pipeline.h:20
Definition: Renderer.h:43
Definition: ShadowMapArrayIndexManager.h:25
Renderer *const pRenderer
Definition: ShadowMapArrayIndexManager.h:134
const std::string sShaderArrayResourceName
Definition: ShadowMapArrayIndexManager.h:137
Definition: ShadowMapHandle.h:23