Loading...
Searching...
No Matches
score::gfx::BackgroundNode Struct Reference
Inheritance diagram for score::gfx::BackgroundNode:
score::gfx::OutputNode score::gfx::Node

Public Member Functions

 BackgroundNode (SharedDeviceMode deviceMode=SharedDeviceMode::Owned)
 
void startRendering () override
 
void render () override
 
void onRendererChange () override
 
bool canRender () const override
 
void stopRendering () override
 
void setRenderer (std::shared_ptr< RenderList > r) override
 
RenderListrenderer () const override
 
void createOutput (score::gfx::OutputConfiguration conf) override
 
void destroyOutput () override
 
void updateGraphicsAPI (GraphicsApi api) override
 
void setSwapchainFormat (Gfx::SwapchainFormat format)
 
void setSize (QSize newSz)
 
void setRenderSize (QSize newSz)
 
void resize ()
 
std::shared_ptr< RenderStaterenderState () const override
 
score::gfx::TextureRenderTarget currentRenderTarget () const noexcept override
 The output's current backing render target + render-pass descriptor, as the upstream nodes should render into it NOW.
 
score::gfx::OutputNodeRenderercreateRenderer (RenderList &r) const noexcept override
 Create a renderer in a given context for this node.
 
OutputNode::Configuration configuration () const noexcept override
 
- Public Member Functions inherited from score::gfx::OutputNode
virtual void setVSyncCallback (std::function< void()>)
 Set a callback to drive rendering when there is a single output.
 
GpuResourceRegistryacquireRegistry ()
 Persistent GPU resource registry for this output.
 
GpuResourceRegistryregistry () const noexcept
 Non-owning accessor. Returns null if no registry has been acquired yet (e.g. queried before the first RenderList::init).
 
void releaseRegistry ()
 Tear down the registry's QRhi resources directly. Idempotent.
 
- Public Member Functions inherited from score::gfx::Node
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
Nodeoperator= (const Node &)=delete
 
Nodeoperator= (Node &&)=delete
 
virtual void renderedNodesChanged ()
 Whenever render nodes are added / removed.
 
virtual void process (Message &&msg)
 Process a message from the execution engine.
 
virtual void update ()
 
void materialChange () noexcept
 Used to notify a material change from the model to the renderers.
 
bool hasMaterialChanged (int64_t &renderer) const noexcept
 
void renderTargetChange () noexcept
 Used to notify a render target (texture inlet) change from the model to the renderers.
 
bool hasRenderTargetChanged (int64_t &renderer) const noexcept
 
bool hasExplicitRenderTargetSize (int32_t port) const noexcept
 Whether a given port has a user-specified render target size.
 
QSize resolveRenderTargetSize (int32_t port, RenderList &renderer) const noexcept
 
RenderTargetSpecs resolveRenderTargetSpecs (int32_t port, RenderList &renderer) const noexcept
 
void process (int32_t port, const ossia::render_target_spec &v)
 

Public Attributes

std::shared_ptr< QRhiReadbackResult > shared_readback
 
- Public Attributes inherited from score::gfx::Node
std::vector< Port * > input
 Input ports of that node.
 
ossia::small_pod_vector< Port *, 1 > output
 Output ports of that node.
 
ossia::flat_map< RenderList *, score::gfx::NodeRenderer * > renderedNodes
 Map associating each RenderList to a Renderer for this model.
 
ossia::flat_map< int32_t, ossia::render_target_spec > renderTargetSpecs
 Render target info.
 
std::atomic_int64_t materialChanged {0}
 
std::atomic_int64_t renderTargetSpecChanged {-1}
 
int32_t nodeId = score::gfx::invalid_node_index
 
bool requiresDepth {}
 

Additional Inherited Members

- Protected Member Functions inherited from score::gfx::OutputNode
void releaseOwnedRenderList ()
 Invoke OutputConfiguration::onReleaseRenderList, if any.
 
- Protected Attributes inherited from score::gfx::OutputNode
std::function< void()> m_onReleaseRenderList
 
std::unique_ptr< GpuResourceRegistrym_registry
 

Member Function Documentation

◆ canRender()

bool score::gfx::BackgroundNode::canRender ( ) const
inlineoverridevirtual

◆ configuration()

OutputNode::Configuration score::gfx::BackgroundNode::configuration ( ) const
inlineoverridevirtualnoexcept

◆ createOutput()

void score::gfx::BackgroundNode::createOutput ( score::gfx::OutputConfiguration  conf)
inlineoverridevirtual

◆ createRenderer()

score::gfx::OutputNodeRenderer * score::gfx::BackgroundNode::createRenderer ( RenderList r) const
inlineoverridevirtualnoexcept

Create a renderer in a given context for this node.

Implements score::gfx::OutputNode.

◆ currentRenderTarget()

score::gfx::TextureRenderTarget score::gfx::BackgroundNode::currentRenderTarget ( ) const
inlineoverridevirtualnoexcept

The output's current backing render target + render-pass descriptor, as the upstream nodes should render into it NOW.

A sink whose render target / render-pass descriptor can be recreated mid-session (e.g. an offscreen BackgroundNode on a viewport resize, which deleteLater()s the old target and installs a fresh one) must override this so that a renderer which cached the target by value at construction can re-adopt the live handles when it is rebuilt (RenderList::maybeRebuild -> OutputNodeRenderer::init). The default returns an empty target, meaning "nothing to refresh — keep the value captured at createRenderer() time".

Without this, the resize fast-path (resizeSwapchainSizedTargets, which rebuilds the RenderList in place instead of reconstructing the renderer) leaves the upstream node's final pass bound to the freed render-pass descriptor — a Vulkan use-after-free of the VkRenderPass.

Reimplemented from score::gfx::OutputNode.

◆ destroyOutput()

void score::gfx::BackgroundNode::destroyOutput ( )
inlineoverridevirtual

◆ onRendererChange()

void score::gfx::BackgroundNode::onRendererChange ( )
inlineoverridevirtual

◆ render()

void score::gfx::BackgroundNode::render ( )
inlineoverridevirtual

◆ renderer()

RenderList * score::gfx::BackgroundNode::renderer ( ) const
inlineoverridevirtual

◆ renderState()

std::shared_ptr< RenderState > score::gfx::BackgroundNode::renderState ( ) const
inlineoverridevirtual

◆ setRenderer()

void score::gfx::BackgroundNode::setRenderer ( std::shared_ptr< RenderList r)
inlineoverridevirtual

◆ startRendering()

void score::gfx::BackgroundNode::startRendering ( )
inlineoverridevirtual

◆ stopRendering()

void score::gfx::BackgroundNode::stopRendering ( )
inlineoverridevirtual

◆ updateGraphicsAPI()

void score::gfx::BackgroundNode::updateGraphicsAPI ( GraphicsApi  api)
inlineoverridevirtual

Reimplemented from score::gfx::OutputNode.


The documentation for this struct was generated from the following file: