Graphics: Replace RenderFrame by RenderResources
This changes makes the whole rendering independent from the RenderFrame acquired from the Swapchain. This may allow to do offscreen rendering (= without swapchain), or multi-window rendering in the future
This commit is contained in:
@@ -24,15 +24,19 @@ namespace Nz
|
||||
|
||||
void Execute(const FunctionRef<void(CommandBufferBuilder& builder)>& callback, QueueTypeFlags queueTypeFlags) override;
|
||||
|
||||
UInt32 GetImageIndex() const override;
|
||||
OpenGLUploadPool& GetUploadPool() override;
|
||||
|
||||
void Present() override;
|
||||
|
||||
inline void Reset(UInt32 imageIndex);
|
||||
|
||||
void SubmitCommandBuffer(CommandBuffer* commandBuffer, QueueTypeFlags queueTypeFlags) override;
|
||||
|
||||
private:
|
||||
OpenGLSwapchain& m_owner;
|
||||
OpenGLUploadPool m_uploadPool;
|
||||
UInt32 m_imageIndex;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline void OpenGLRenderImage::Reset(UInt32 imageIndex)
|
||||
{
|
||||
m_imageIndex = imageIndex;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/OpenGLRenderer/DebugOff.hpp>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Nz
|
||||
|
||||
inline GL::Context& GetContext();
|
||||
inline OpenGLDevice& GetDevice();
|
||||
const OpenGLFramebuffer& GetFramebuffer(std::size_t i) const override;
|
||||
const OpenGLFramebuffer& GetFramebuffer(std::size_t imageIndex) const override;
|
||||
std::size_t GetFramebufferCount() const override;
|
||||
PresentMode GetPresentMode() const override;
|
||||
const OpenGLRenderPass& GetRenderPass() const override;
|
||||
@@ -46,17 +46,17 @@ namespace Nz
|
||||
|
||||
void SetPresentMode(PresentMode presentMode) override;
|
||||
|
||||
TransientResources& Transient() override;
|
||||
RenderResources& GetTransientResources() override;
|
||||
|
||||
private:
|
||||
std::optional<OpenGLRenderPass> m_renderPass;
|
||||
std::size_t m_currentFrame;
|
||||
std::shared_ptr<GL::Context> m_context;
|
||||
std::vector<std::unique_ptr<OpenGLRenderImage>> m_renderImage;
|
||||
OpenGLDevice& m_device;
|
||||
OpenGLWindowFramebuffer m_framebuffer;
|
||||
PresentMode m_presentMode;
|
||||
PresentModeFlags m_supportedPresentModes;
|
||||
UInt32 m_currentImageIndex;
|
||||
Vector2ui m_size;
|
||||
bool m_sizeInvalidated;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user