![]() |
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 <qssgrenderextensions.h>
Public Types | |
| enum class | RenderResult : quint32 { AoTexture , DepthTexture , ScreenTexture , NormalTexture , MotionVectorTexture } |
| enum class | AttachmentSelector : quint32 { Attachment0 = 0 , Attachment1 = 1 , Attachment2 = 2 , Attachment3 = 3 , DepthAttachment = 0x8000 } |
| Selects an attachment of a \l {QtQuick3D::RenderPass}{RenderPass}. More... | |
| using | TypeMask = QSSGRenderGraphObject::TypeT |
Public Member Functions | |
| void | scheduleRenderResults (RenderResults results) const |
| Schedule the given results to be made available for this frame. | |
| QSSGRhiResourceHandle | getRhiResource (QSSGResourceId resourceId) const |
| QSSGRhiResourceHandle | getRhiResource (RenderResult idid) const |
| QSSGRhiResourceHandle | getRhiResource (QSSGResourceId userPassId, AttachmentSelector attachmentattachment) const |
| qsizetype | getAttachmentCount (QSSGResourceId userPassId) const |
| QSSGRhiGraphicsPipelineState | getPipelineState () const |
| QSSGCameraId | activeCamera () const |
| QSSGRenderContextInterface * | contextInterface () const |
| QSSGNodeIdList | getLayerNodes (quint32 layerMask, TypeMask typeMask=NodeMask) const |
| QSSGNodeIdList | getLayerNodes (QSSGCameraId cameraId, TypeMask typeMask=NodeMask) const |
Static Public Attributes | |
| static constexpr TypeMask | NodeMask = QSSGRenderGraphObject::BaseType::Node |
Friends | |
| class | QSSGLayerRenderData |
| class | QSSGRenderOutputProviderExtension |
\inmodule QtQuick3D
Storage class containing data collected for a frame.
Definition at line 68 of file qssgrenderextensions.h.
Definition at line 101 of file qssgrenderextensions.h.
|
strong |
Selects an attachment of a \l {QtQuick3D::RenderPass}{RenderPass}.
\value Attachment0 The first color attachment. \value Attachment1 The second color attachment. \value Attachment2 The third color attachment. \value Attachment3 The fourth color attachment. \value [since 6.13] DepthAttachment The depth attachment. This is a texture when the render pass uses a DepthTextureAttachment, otherwise the depth-stencil render buffer.
| Enumerator | |
|---|---|
| Attachment0 | |
| Attachment1 | |
| Attachment2 | |
| Attachment3 | |
| DepthAttachment | |
Definition at line 81 of file qssgrenderextensions.h.
|
strong |
| Enumerator | |
|---|---|
| AoTexture | |
| DepthTexture | |
| ScreenTexture | |
| NormalTexture | |
| MotionVectorTexture | |
Definition at line 71 of file qssgrenderextensions.h.
|
nodiscard |
Definition at line 403 of file qssgrenderextensions.cpp.
|
nodiscard |
Definition at line 414 of file qssgrenderextensions.cpp.
| qsizetype QSSGFrameData::getAttachmentCount | ( | QSSGResourceId | userPassId | ) | const |
Definition at line 128 of file qssgrenderextensions.cpp.
|
nodiscard |
Definition at line 437 of file qssgrenderextensions.cpp.
|
nodiscard |
Definition at line 422 of file qssgrenderextensions.cpp.
|
nodiscard |
Definition at line 393 of file qssgrenderextensions.cpp.
|
nodiscard |
resourceId identifies the scene resource, a \l {QtQuick3D::ShaderImage}{ShaderImage} or a \l {QtQuick3D::ShaderStorageBuffer}{ShaderStorageBuffer}; use \l QQuick3DExtensionHelpers::getResourceId() to get it. For the attachments of a \l {QtQuick3D::RenderPass}{RenderPass}, use the overload that takes an AttachmentSelector instead. The returned handle refers to the QRhiTexture or QRhiBuffer the renderer created for it, see QSSGRhiResourceHandle::texture() and QSSGRhiResourceHandle::buffer(). The scene resource keeps its id when the renderer replaces that RHI resource, so call this function again rather than storing the result; see \l {QSSGRhiResourceHandle#Scene resources and RHI resources}{Scene resources and RHI resources}.
The resource is shared by every View3D in the window, independent of which one uses it. When called from \l QSSGRenderExtension::prepareData(), the resource is created, or recreated if the scene resource changed, before the handle is returned, so the handle refers to the resource used for the rest of the frame. For a ShaderStorageBuffer, new content from \l {QtQuick3D::ShaderStorageBuffer::bufferData}{bufferData} and a \l {QtQuick3D::ShaderStorageBuffer::requestClear()}{requestClear()} are applied then as well. When called later in the frame, the function only looks up the resource and returns an invalid handle if no pass has used it yet. Pending changes are not applied then, and until a pass uses the resource, it can still have its previous size and content.
If the ShaderStorageBuffer has a \l {QtQuick3D::ShaderStorageBuffer::bufferProvider}{buffer provider} that has registered a buffer with \l QSSGRenderExtensionHelpers::registerRenderResultBuffer(), the handle refers to that buffer. It becomes invalid when the provider registers a different buffer, unregisters it or is destroyed. How long the buffer itself lives depends on its \l {QSSGRenderExtensionHelpers::ResultOwnership}{ownership}.
The handle does not keep the resource alive. Check QSSGRhiResourceHandle::isValid() before using a handle kept from an earlier frame, and compare it with the result of a new call to find out whether the resource has been replaced.
Main \l {QSSGRenderExtension::RenderMode}{render mode} and the PostColor \l {QSSGRenderExtension::RenderStage}{render stage}. The order in which different View3Ds are rendered is not defined.Definition at line 339 of file qssgrenderextensions.cpp.
|
nodiscard |
For a color attachment, QSSGRhiResourceHandle::texture() returns the texture. For \l {QSSGFrameData::AttachmentSelector}{DepthAttachment}, the handle refers to a texture if the render pass has a DepthTextureAttachment, and to a render buffer, returned by QSSGRhiResourceHandle::renderBuffer(), otherwise.
The handle can be kept across frames. It becomes invalid when the render pass replaces the attachment, for example when the size of the View3D changes, or when the render pass is destroyed. Compare it with the result of a new call to find out whether the attachment has changed, see QSSGRhiResourceHandle.
Definition at line 264 of file qssgrenderextensions.cpp.
|
nodiscard |
The renderer only produces the results that something in the frame needs, so request the result with scheduleRenderResults() during \l QSSGRenderExtension::prepareData(), in every frame it is needed, and before calling this function. The texture contains the result once the pass producing it has run, so it is typically read by an extension with the Main \l {QSSGRenderExtension::RenderMode}{render mode}.
The handle can be kept across frames. The renderer can replace or rebuild the texture, for example when the size of the View3D changes, and can release it once the result is no longer produced. The handle then becomes invalid, so compare it with the result of a new call to find out whether the texture has changed, see QSSGRhiResourceHandle. In a frame where the result is not produced, this function returns an invalid handle even if a handle kept from an earlier frame is still valid, and the content of the texture is undefined.
Definition at line 223 of file qssgrenderextensions.cpp.
| void QSSGFrameData::scheduleRenderResults | ( | RenderResults | results | ) | const |
Schedule the given results to be made available for this frame.
This function should only be called during the prepare phase in \l QSSGRenderExtension::prepareData().
Definition at line 102 of file qssgrenderextensions.cpp.
|
friend |
Definition at line 131 of file qssgrenderextensions.h.
|
friend |
Definition at line 132 of file qssgrenderextensions.h.
|
staticconstexpr |
Definition at line 102 of file qssgrenderextensions.h.