2#include <Gfx/Graph/Node.hpp>
3#include <Gfx/Graph/NodeRenderer.hpp>
4#include <Gfx/Graph/RenderState.hpp>
5#include <Gfx/Graph/Uniforms.hpp>
7#include <score_plugin_gfx_export.h>
13class GpuResourceRegistry;
18 std::function<void()> onReady;
19 std::function<void()> onResize;
39 using score::gfx::NodeRenderer::NodeRenderer;
42 finishFrame(
RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res);
59 virtual void setRenderer(std::shared_ptr<RenderList>) = 0;
64 virtual void startRendering() = 0;
65 virtual void render() = 0;
66 virtual void stopRendering() = 0;
67 virtual bool canRender()
const = 0;
68 virtual void onRendererChange() = 0;
76 virtual void setVSyncCallback(std::function<
void()>);
81 virtual void destroyOutput() = 0;
82 virtual std::shared_ptr<RenderState> renderState()
const = 0;
88 std::optional<double> manualRenderingRate;
89 bool outputNeedsRenderPass{};
158 void releaseRegistry();
166 virtual bool deviceLost() const noexcept {
return m_deviceLost; }
171 void handleDeviceLost(
const char* output)
noexcept;
178 bool checkDeviceLost(
const OffscreenFrame& frame, QRhi& rhi,
const char* output)
noexcept;
179 bool checkDeviceLost(
int frameOpResult, QRhi& rhi,
const char* output)
noexcept;
181 void resetDeviceLost() noexcept { m_deviceLost =
false; }
183 explicit OutputNode();
193 void releaseOwnedRenderList();
197 std::function<void()> m_onReleaseRenderList;
203 std::unique_ptr<GpuResourceRegistry> m_registry;
Per-RenderList arena store for GPU-resident scene data.
Definition GpuResourceRegistry.hpp:44
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:76
Renderer for a given node.
Definition NodeRenderer.hpp:11
Base class for sink nodes (QWindow, spout, syphon, NDI output, ...)
Definition OutputNode.hpp:55
OutputNodeRenderer * createRenderer(RenderList &r) const noexcept override=0
Create a renderer in a given context for this node.
GpuResourceRegistry * registry() const noexcept
Non-owning accessor. Returns null if no registry has been acquired yet (e.g. queried before the first...
Definition OutputNode.hpp:144
virtual bool deviceLost() const noexcept
True once the output's graphics device was reported lost.
Definition OutputNode.hpp:166
Definition OutputNode.hpp:37
void removeOutputPass(RenderList &, Edge &) override
Definition OutputNode.hpp:47
List of nodes to be rendered to an output.
Definition RenderList.hpp:33
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:22
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:220
RAII bracket for QRhi::beginOffscreenFrame / endOffscreenFrame.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:49
Definition OutputNode.hpp:16
std::function< void()> onReleaseRenderList
Ask the owning Graph to release + deregister the RenderList that was built against this output's QRhi...
Definition OutputNode.hpp:33
Definition OutputNode.hpp:85
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:279