Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSSGRenderExtensionHelpers Class Reference

\inmodule QtQuick3D More...

#include <qssgrenderhelpers.h>

Collaboration diagram for QSSGRenderExtensionHelpers:

Public Types

enum class  ResultOwnership : quint8 { Extension , Renderer }

Static Public Member Functions

static void registerRenderResult (const QSSGFrameData &frameData, QSSGExtensionId extension, QRhiTexture *texturetexture)
 Register a render result, in form of a texture, for this extension.
static void registerRenderResult (const QSSGFrameData &frameData, QSSGExtensionId extension, QRhiTexture *texturetexture, ResultOwnership ownership)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static void registerRenderResultBuffer (const QSSGFrameData &frameData, QSSGExtensionId extension, QRhiBuffer *bufferbuffer)
 Register a render result, in form of a buffer, for this extension.
static void registerRenderResultBuffer (const QSSGFrameData &frameData, QSSGExtensionId extension, QRhiBuffer *bufferbuffer, ResultOwnership ownership)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Detailed Description

\inmodule QtQuick3D

Since
6.7

Class containing helper functions for the extensions.

Definition at line 147 of file qssgrenderhelpers.h.

Member Enumeration Documentation

◆ ResultOwnership

Since
6.13

Specifies who owns a texture or buffer registered as the render result of an extension.

\value Extension The extension owns the resource. It must unregister the resource before destroying it, and destroy it with QRhiResource::deleteLater() rather than deleting it directly, since the renderer may still use it in the current frame. When the extension replaces the resource in QSSGRenderExtension::prepareData(), it can instead destroy the previous resource right away, before registering the new one, as long as both happen in the same call. The extension can register the same resource again later, and more than one extension can register it. \value Renderer The renderer takes ownership of the resource, and destroys it with QRhiResource::deleteLater() when it is unregistered, when the extension is destroyed, or when the window's graphics resources are destroyed. The extension can keep using the resource while it is registered, for example to write to it, and until the end of the frame in which it was unregistered. It must not destroy the resource itself, or register it again once it has been unregistered. Only one extension can register the resource. Only a resource the extension created itself, with the QRhi of the window, can be handed over; a resource obtained from QSSGFrameData belongs to the renderer already.

See also
registerRenderResult(), registerRenderResultBuffer()
Enumerator
Extension 
Renderer 

Definition at line 150 of file qssgrenderhelpers.h.

Member Function Documentation

◆ registerRenderResult() [1/2]

void QSSGRenderExtensionHelpers::registerRenderResult ( const QSSGFrameData & frameData,
QSSGExtensionId extension,
QRhiTexture * texture )
static

Register a render result, in form of a texture, for this extension.

Once a texture is registered, the extension can be used as a {QtQuick3D::Texture::textureProvider}{texture provider} in QML.

Note
To ensure that the texture is available for renderables, for example to be used by a {QtQuick3D::Texture} item, textures should be registered during the \l QSSGRenderExtension::prepareData call of the extension.
Calling this function with a new texture will unregister any previously registered texture. To unregister a texture, call this function with a nullptr texture.

The extension keeps ownership of the texture, as with ResultOwnership::Extension.

frameData

See also
{QtQuick3D::Texture::textureProvider}{textureProvider}

Definition at line 450 of file qssgrenderhelpers.cpp.

◆ registerRenderResult() [2/2]

void QSSGRenderExtensionHelpers::registerRenderResult ( const QSSGFrameData & frameData,
QSSGExtensionId extension,
QRhiTexture * texture,
ResultOwnership ownership )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.13

Registers texture as the render result of extension, with ownership specifying whether the extension or the renderer owns it. Registering the texture that is already registered only changes its ownership.

frameData

See also
ResultOwnership

Definition at line 470 of file qssgrenderhelpers.cpp.

◆ registerRenderResultBuffer() [1/2]

void QSSGRenderExtensionHelpers::registerRenderResultBuffer ( const QSSGFrameData & frameData,
QSSGExtensionId extension,
QRhiBuffer * buffer )
static

Register a render result, in form of a buffer, for this extension.

Once a buffer is registered, the extension can be used as a \l {QtQuick3D::ShaderStorageBuffer::bufferProvider}{buffer provider} in QML.

To ensure that the buffer is available for renderables, for example, to be used by a \l {QtQuick3D::ShaderStorageBuffer}{ShaderStorageBuffer} item, buffers must be registered during the \l QSSGRenderExtension::prepareData call of the extension.

Calling this function with a new buffer unregisters any previously registered buffer. To unregister a buffer, call this function with a nullptr buffer. A ShaderStorageBuffer that uses the extension as its buffer provider then falls back to a buffer of its own, holding its bufferData, or empty if it has none.

The extension keeps ownership of the buffer, as with ResultOwnership::Extension.

frameData

Since
6.13
See also
{QtQuick3D::ShaderStorageBuffer::bufferProvider}{bufferProvider}

Definition at line 504 of file qssgrenderhelpers.cpp.

◆ registerRenderResultBuffer() [2/2]

void QSSGRenderExtensionHelpers::registerRenderResultBuffer ( const QSSGFrameData & frameData,
QSSGExtensionId extension,
QRhiBuffer * buffer,
ResultOwnership ownership )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.13

Registers buffer as the render result of extension, with ownership specifying whether the extension or the renderer owns it. Registering the buffer that is already registered only changes its ownership.

frameData

See also
ResultOwnership

Definition at line 524 of file qssgrenderhelpers.cpp.


The documentation for this class was generated from the following files: