Integrate render target handling in frame graphs (#411)

* Graphics: Integrate RenderTarget in FrameGraph

- This handles the blit to texture/swapchain in the FrameGraph and fixes RenderTextureBlit
- Dummy attachments were added to the FrameGraph class to handle link without texture (used to setup a dependency between two passes with no texture)
- FramePass now supports custom access/layout/usage for inputs

* Graphics/RenderTarget: Allow to set any RenderTarget as output
This commit is contained in:
Jérôme Leclercq
2023-11-28 21:00:57 +01:00
committed by GitHub
parent f57fc3c1d5
commit 32d227628c
19 changed files with 490 additions and 340 deletions

View File

@@ -19,22 +19,33 @@ namespace Nz
class Framebuffer;
class FrameGraph;
class RenderPass;
class Texture;
class RenderResources;
class Texture;
class NAZARA_GRAPHICS_API RenderTarget
{
public:
RenderTarget() = default;
inline RenderTarget(Int32 renderOrder = 0);
virtual ~RenderTarget();
virtual void OnBuildGraph(FrameGraph& frameGraph, std::size_t attachmentIndex) const = 0;
virtual void OnRenderEnd(RenderResources& resources, const BakedFrameGraph& frameGraph, std::size_t finalAttachment) const = 0;
inline Int32 GetRenderOrder() const;
virtual const Vector2ui& GetSize() const = 0;
inline bool IsFrameGraphOutput() const;
virtual std::size_t OnBuildGraph(FrameGraph& frameGraph, std::size_t attachmentIndex) const = 0;
inline void SetFrameGraphOutput(bool output = true);
inline void UpdateRenderOrder(Int32 renderOrder);
NazaraSignal(OnRenderTargetRelease, const RenderTarget* /*renderTarget*/);
NazaraSignal(OnRenderTargetRenderOrderChange, const RenderTarget* /*renderTarget*/, Int32 /*newOrder*/);
NazaraSignal(OnRenderTargetSizeChange, const RenderTarget* /*renderTarget*/, const Vector2ui& /*newSize*/);
private:
Int32 m_renderOrder;
bool m_frameGraphOutput;
};
}