![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtQuick3D More...
#include <qssgrenderhelpers.h>
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. | |
\inmodule QtQuick3D
Class containing helper functions for the extensions.
Definition at line 147 of file qssgrenderhelpers.h.
|
strong |
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.
| Enumerator | |
|---|---|
| Extension | |
| Renderer | |
Definition at line 150 of file qssgrenderhelpers.h.
|
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.
nullptr texture.The extension keeps ownership of the texture, as with ResultOwnership::Extension.
frameData
Definition at line 450 of file qssgrenderhelpers.cpp.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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
Definition at line 470 of file qssgrenderhelpers.cpp.
|
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
Definition at line 504 of file qssgrenderhelpers.cpp.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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
Definition at line 524 of file qssgrenderhelpers.cpp.