Nameless Engine
|
#include <VulkanShadowMapArrayIndexManager.h>
Classes | |
struct | InternalData |
Public Member Functions | |
VulkanShadowMapArrayIndexManager (const VulkanShadowMapArrayIndexManager &)=delete | |
VulkanShadowMapArrayIndexManager & | operator= (const VulkanShadowMapArrayIndexManager &)=delete |
VulkanShadowMapArrayIndexManager (VulkanShadowMapArrayIndexManager &&) noexcept=delete | |
VulkanShadowMapArrayIndexManager & | operator= (VulkanShadowMapArrayIndexManager &&) noexcept=delete |
VulkanShadowMapArrayIndexManager (Renderer *pRenderer, const std::string &sShaderArrayResourceName) | |
Public Member Functions inherited from ne::ShadowMapArrayIndexManager | |
ShadowMapArrayIndexManager (const ShadowMapArrayIndexManager &)=delete | |
ShadowMapArrayIndexManager & | operator= (const ShadowMapArrayIndexManager &)=delete |
ShadowMapArrayIndexManager (ShadowMapArrayIndexManager &&) noexcept=delete | |
ShadowMapArrayIndexManager & | operator= (ShadowMapArrayIndexManager &&) noexcept=delete |
Protected Member Functions | |
virtual std::optional< Error > | registerShadowMapResource (ShadowMapHandle *pShadowMapHandle) override |
virtual std::optional< Error > | unregisterShadowMapResource (ShadowMapHandle *pShadowMapHandle) override |
virtual std::optional< Error > | bindShadowMapsToPipeline (Pipeline *pPipeline) override |
virtual std::optional< Error > | bindShadowMapsToAllPipelines () override |
Protected Member Functions inherited from ne::ShadowMapArrayIndexManager | |
ShadowMapArrayIndexManager (Renderer *pRenderer, const std::string &sShaderArrayResourceName) | |
virtual std::optional< Error > | registerShadowMapResource (ShadowMapHandle *pShadowMapHandle)=0 |
virtual std::optional< Error > | unregisterShadowMapResource (ShadowMapHandle *pShadowMapHandle)=0 |
virtual std::optional< Error > | bindShadowMapsToPipeline (Pipeline *pPipeline)=0 |
virtual std::optional< Error > | bindShadowMapsToAllPipelines ()=0 |
std::string_view | getShaderArrayResourceName () |
Renderer * | getRenderer () const |
Private Member Functions | |
std::optional< Error > | bindShadowMapsToAllPipelines (ShadowMapHandle *pOnlyBindThisShadowMap) |
std::optional< Error > | bindShadowMapsToPipeline (Pipeline *pPipeline, ShadowMapHandle *pOnlyBindThisShadowMap) |
std::optional< Error > | bindShadowMapToPipelineIfUsed (ShadowMapHandle *pShadowMapHandle, VulkanPipeline *pPipeline, VkSampler pSampler) |
Private Attributes | |
std::pair< std::recursive_mutex, InternalData > | mtxInternalData |
Additional Inherited Members | |
Static Public Member Functions inherited from ne::ShadowMapArrayIndexManager | |
static std::variant< std::unique_ptr< ShadowMapArrayIndexManager >, Error > | create (Renderer *pRenderer, GpuResourceManager *pResourceManager, const std::string &sShaderArrayResourceName) |
Static Protected Member Functions inherited from ne::ShadowMapArrayIndexManager | |
static void | changeShadowMapArrayIndex (ShadowMapHandle *pShadowMapHandle, unsigned int iNewArrayIndex) |
Manages indices of shadows maps into a descriptor array used by shaders.
ne::VulkanShadowMapArrayIndexManager::VulkanShadowMapArrayIndexManager | ( | Renderer * | pRenderer, |
const std::string & | sShaderArrayResourceName | ||
) |
Initializes the manager.
pRenderer | Renderer. |
sShaderArrayResourceName | Name of the array (defined in shaders) that this manager controls. |
|
overrideprotectedvirtual |
Goes through all graphics pipelines ad binds shadow maps to pipelines that use them.
Implements ne::ShadowMapArrayIndexManager.
|
private |
Goes through all graphics pipelines ad binds shadow map(s) to pipelines that use them.
pOnlyBindThisShadowMap | If nullptr then binds all shadow maps from mtxInternalData, otherwise only binds the specified already registered (!) shadow map to all pipelines that reference it. |
|
overrideprotectedvirtual |
Looks if the specified pipeline uses shadow maps and if uses binds shadow maps to the pipeline.
pPipeline | Pipeline to bind shadow maps to. |
Implements ne::ShadowMapArrayIndexManager.
|
private |
Looks if the specified pipeline uses shadow map(s) and if uses binds shadow map(s) to the pipeline.
pPipeline | Pipeline to bind shadow maps to. |
pOnlyBindThisShadowMap | If nullptr then binds all shadow maps from mtxInternalData, otherwise only binds the specified already registered (!) shadow map to the specified pipelines if it references it. |
|
private |
|
overrideprotectedvirtual |
Reserves an index into a descriptor array for the shadow map resource of the specified handle and bind internal GPU shadow map resource (if the handle) to that descriptor.
pShadowMapHandle | Shadow map to register. |
Implements ne::ShadowMapArrayIndexManager.
|
overrideprotectedvirtual |
Unregisters a shadow map and frees its index into a descriptor array to be used by others.
pShadowMapHandle | Shadow map to unregister. |
Implements ne::ShadowMapArrayIndexManager.
|
private |
Mutex guarded internal data.