Graphics: Rework RenderTargets
- RenderTarget have been moved to the Graphics module and are now lightweight objects between the target of rendering (swapchain or texture) - RenderTexture no longer require a blit between the framegraph texture and the target texture (the target texture is now directly rendered onto using a new feature of the framegraph) - ForwardFramePipeline viewers are now properly ordered by render order
This commit is contained in:
43
include/Nazara/Graphics/RenderTarget.hpp
Normal file
43
include/Nazara/Graphics/RenderTarget.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_GRAPHICS_RENDERTARGET_HPP
|
||||
#define NAZARA_GRAPHICS_RENDERTARGET_HPP
|
||||
|
||||
#include <NazaraUtils/Prerequisites.hpp>
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
#include <NazaraUtils/Signal.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class BakedFrameGraph;
|
||||
class CommandBufferBuilder;
|
||||
class Framebuffer;
|
||||
class FrameGraph;
|
||||
class RenderFrame;
|
||||
class RenderPass;
|
||||
class Texture;
|
||||
|
||||
class NAZARA_GRAPHICS_API RenderTarget
|
||||
{
|
||||
public:
|
||||
RenderTarget() = default;
|
||||
virtual ~RenderTarget();
|
||||
|
||||
virtual void OnBuildGraph(FrameGraph& frameGraph, std::size_t attachmentIndex) const = 0;
|
||||
virtual void OnRenderEnd(RenderFrame& renderFrame, const BakedFrameGraph& frameGraph, std::size_t finalAttachment) const = 0;
|
||||
|
||||
virtual const Vector2ui& GetSize() const = 0;
|
||||
|
||||
NazaraSignal(OnRenderTargetRelease, const RenderTarget* /*renderTarget*/);
|
||||
NazaraSignal(OnRenderTargetSizeChange, const RenderTarget* /*renderTarget*/, const Vector2ui& /*newSize*/);
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/RenderTarget.inl>
|
||||
|
||||
#endif // NAZARA_GRAPHICS_RENDERTARGET_HPP
|
||||
Reference in New Issue
Block a user