Nameless Engine
|
#include <ShadowMapArrayIndexManager.h>
Public Member Functions | |
ShadowMapArrayIndexManager (const ShadowMapArrayIndexManager &)=delete | |
ShadowMapArrayIndexManager & | operator= (const ShadowMapArrayIndexManager &)=delete |
ShadowMapArrayIndexManager (ShadowMapArrayIndexManager &&) noexcept=delete | |
ShadowMapArrayIndexManager & | operator= (ShadowMapArrayIndexManager &&) noexcept=delete |
Static Public Member Functions | |
static std::variant< std::unique_ptr< ShadowMapArrayIndexManager >, Error > | create (Renderer *pRenderer, GpuResourceManager *pResourceManager, const std::string &sShaderArrayResourceName) |
Protected Member Functions | |
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 |
Static Protected Member Functions | |
static void | changeShadowMapArrayIndex (ShadowMapHandle *pShadowMapHandle, unsigned int iNewArrayIndex) |
Private Attributes | |
Renderer *const | pRenderer = nullptr |
const std::string | sShaderArrayResourceName |
Friends | |
class | ShadowMapManager |
Manages indices of shadows maps into a descriptor array used by shaders.
Allows requesting an index into the array of shadow maps and binds specified shadow map to array's descriptor.
Binds array of descriptors to the rendering pipeline to be used by shaders.
|
protected |
Initializes object.
pRenderer | Renderer. |
sShaderArrayResourceName | Name of the array (defined in shaders) that this manager controls. |
|
protectedpure virtual |
Goes through all graphics pipelines and binds shadow maps to pipelines that use them.
Implemented in ne::DirectXShadowMapArrayIndexManager, and ne::VulkanShadowMapArrayIndexManager.
|
protectedpure virtual |
Looks if the specified pipeline uses shadow maps and if uses binds shadow maps to the pipeline.
pPipeline | Pipeline to bind shadow maps to. |
Implemented in ne::DirectXShadowMapArrayIndexManager, and ne::VulkanShadowMapArrayIndexManager.
|
staticprotected |
Usually called by derived classes to notify some shadow map handle that its descriptor array index was changed (because base index manager class is a friend class to the shadow map handle).
pShadowMapHandle | Shadow map handle to notify. |
iNewArrayIndex | New array index for this shadow map. |
|
static |
|
protected |
|
protected |
Returns name of the array (defined in shaders) that this manager controls.
|
protectedpure virtual |
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. |
Implemented in ne::DirectXShadowMapArrayIndexManager, and ne::VulkanShadowMapArrayIndexManager.
|
protectedpure virtual |
Unregisters a shadow map and frees its index into a descriptor array to be used by others.
pShadowMapHandle | Shadow map to unregister. |
Implemented in ne::DirectXShadowMapArrayIndexManager, and ne::VulkanShadowMapArrayIndexManager.
|
private |
Do not delete (free). Renderer.
|
private |
Name of the array (defined in shaders) that this manager controls.