Nameless Engine
|
#include <ShadowMapHandle.h>
Classes | |
struct | InternalResources |
Public Member Functions | |
ShadowMapHandle (const ShadowMapHandle &)=delete | |
ShadowMapHandle & | operator= (const ShadowMapHandle &)=delete |
ShadowMapHandle (ShadowMapHandle &&other) noexcept=delete | |
ShadowMapHandle & | operator= (ShadowMapHandle &&other) noexcept=delete |
std::pair< std::recursive_mutex, InternalResources > * | getResources () |
ShadowMapType | getShadowMapType () const |
size_t | getShadowMapSize () const |
Private Member Functions | |
ShadowMapHandle (ShadowMapManager *pManager, GpuResource *pDepthTexture, ShadowMapType type, size_t iTextureSize, const std::function< void(unsigned int)> &onArrayIndexChanged, GpuResource *pColorTexture=nullptr) | |
void | changeArrayIndex (unsigned int iNewArrayIndex) |
void | setUpdatedResources (GpuResource *pDepthTexture, size_t iShadowMapSize, GpuResource *pColorTexture=nullptr) |
void | recreateFramebuffers () |
Private Attributes | |
ShadowMapManager * | pManager = nullptr |
std::pair< std::recursive_mutex, InternalResources > | mtxResources |
size_t | iShadowMapSize = 0 |
const std::function< void(unsigned int)> | onArrayIndexChanged |
const ShadowMapType | shadowMapType = ShadowMapType::DIRECTIONAL |
Friends | |
class | ShadowMapManager |
class | ShadowMapArrayIndexManager |
Small raw pointer wrapper that acts kind of like std::unique_ptr
for shadow maps to do some extra work when started/stopped referencing a shadow map.
When deleted causes the resource to be also deleted.
|
private |
Constructs a new handle.
pManager | Manager that owns the resource. |
pDepthTexture | Resource to point to. |
type | Type of the shadow map this handle references. |
iTextureSize | Size (in pixels) of the shadow map. |
onArrayIndexChanged | Called after the index of the shadow map into the descriptor array of shadow maps was initialized/changed. |
pColorTexture | Optional "color" target, used for point lights to store additional information. |
|
private |
Called by array index manager to notify the shadow map user about array index changed.
iNewArrayIndex | New array index. |
|
inline |
Returns the underlying resource.
|
inline |
Returns the current size of the shadow map resource.
|
inline |
Returns type of a shadow map that this handle references.
|
private |
(Re)creates framebuffers from mtxResources if running Vulkan renderer.
|
private |
Called by shadow map manager after GPU resources were re-created (due to some render settings changed for example) to assign new resources.
pDepthTexture | Resource to point to. |
iShadowMapSize | Size (in pixels) of the shadow map. |
pColorTexture | Optional "color" target, used for point lights to store additional information. |
|
private |
Size (in pixels) of the mtxResources texture, used for fast access.
|
private |
Resource that this handle references.
|
private |
Called after the index of the shadow map into the descriptor array of shadow maps was initialized/changed.
|
private |
Manager that owns the resource we are pointing to.
|
private |
Type of the shadow map that this handle references.