Plasma Engine  2.0
Loading...
Searching...
No Matches
SharedTextureSwapChain.h
1#pragma once
2
3#include <RendererFoundation/RendererFoundationDLL.h>
4
5#include <RendererFoundation/Device/SwapChain.h>
6#include <RendererFoundation/Resources/Texture.h>
7
9struct plGALSharedTextureSwapChainCreationDescription : public plHashableStruct<plGALSharedTextureSwapChainCreationDescription>
10{
14 plDelegate<void(plUInt32 uiTextureIndex, plUInt64 uiSemaphoreValue)> m_OnPresent;
15};
16
19class PL_RENDERERFOUNDATION_DLL plGALSharedTextureSwapChain : public plGALSwapChain
20{
21 friend class plGALDevice;
22
23public:
25 static void SetFactoryMethod(Functor factory);
26
29
30public:
34 void Arm(plUInt32 uiTextureIndex, plUInt64 uiCurrentSemaphoreValue);
35
36protected:
38 virtual void AcquireNextRenderTarget(plGALDevice* pDevice) override;
39 virtual void PresentRenderTarget(plGALDevice* pDevice) override;
40 virtual plResult UpdateSwapChain(plGALDevice* pDevice, plEnum<plGALPresentMode> newPresentMode) override;
41 virtual plResult InitPlatform(plGALDevice* pDevice) override;
42 virtual plResult DeInitPlatform(plGALDevice* pDevice) override;
43
44protected:
45 static Functor s_Factory;
46
47protected:
48 plUInt32 m_uiCurrentTexture = plMath::MaxValue<plUInt32>();
49 plUInt64 m_uiCurrentSemaphoreValue = 0;
50 plHybridArray<plGALTextureHandle, 3> m_SharedTextureHandles;
51 plHybridArray<const plGALSharedTexture*, 3> m_SharedTextureInterfaces;
52 plHybridArray<plUInt64, 3> m_CurrentSemaphoreValue;
54};
55PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERFOUNDATION_DLL, plGALSharedTextureSwapChain);
The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a ...
Definition Device.h:19
Use to render to a set of shared textures. To use it, it needs to be armed with the next shared textu...
Definition SharedTextureSwapChain.h:20
Definition RendererFoundationDLL.h:397
Definition SwapChain.h:11
This class provides a base class for hashable structs (e.g. descriptor objects).
Definition HashableStruct.h:17
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
constexpr TYPE MaxValue()
Returns the largest possible positive value (that is not infinity).
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Description of a shared texture swap chain. Use plGALSharedTextureSwapChain::Create to create instanc...
Definition SharedTextureSwapChain.h:10
plDelegate< void(plUInt32 uiTextureIndex, plUInt64 uiSemaphoreValue)> m_OnPresent
Called when rendering to a swap chain texture has been submitted to the GPU queue....
Definition SharedTextureSwapChain.h:14
Definition Descriptors.h:177
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54