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:
SirLynix
2023-11-20 23:00:06 +01:00
parent d06f9bda89
commit 938ba09d45
41 changed files with 445 additions and 254 deletions

View File

@@ -12,16 +12,17 @@
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/RenderFrame.hpp>
#include <Nazara/Renderer/RenderPass.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#include <NazaraUtils/Signal.hpp>
#include <vector>
namespace Nz
{
class CommandPool;
class Framebuffer;
class RenderDevice;
class TransientResources;
class NAZARA_RENDERER_API Swapchain : public RenderTarget
class NAZARA_RENDERER_API Swapchain
{
public:
Swapchain() = default;
@@ -29,14 +30,13 @@ namespace Nz
virtual RenderFrame AcquireFrame() = 0;
void BlitTexture(RenderFrame& renderFrame, CommandBufferBuilder& builder, const Texture& texture) const override;
virtual std::shared_ptr<CommandPool> CreateCommandPool(QueueType queueType) = 0;
virtual const Framebuffer& GetFramebuffer(std::size_t i) const = 0;
virtual std::size_t GetFramebufferCount() const = 0;
virtual PresentMode GetPresentMode() const = 0;
virtual const RenderPass& GetRenderPass() const = 0;
virtual const Vector2ui& GetSize() const = 0;
virtual PresentModeFlags GetSupportedPresentModes() const = 0;
virtual void NotifyResize(const Vector2ui& newSize) = 0;
@@ -45,6 +45,8 @@ namespace Nz
virtual TransientResources& Transient() = 0;
NazaraSignal(OnSwapchainResize, Swapchain* /*swapchain*/, const Vector2ui& /*newSize*/);
protected:
static void BuildRenderPass(PixelFormat colorFormat, PixelFormat depthFormat, std::vector<RenderPass::Attachment>& attachments, std::vector<RenderPass::SubpassDescription>& subpassDescriptions, std::vector<RenderPass::SubpassDependency>& subpassDependencies);
};