QSSGFrameData Class
Storage class containing data collected for a frame. More...
| Header: | #include <qssgrenderextensions.h> |
| Since: | Qt 6.7 |
Public Functions
| QSSGCameraId | activeCamera() const |
| QSSGNodeIdList | getLayerNodes(QSSGCameraId cameraId, QSSGFrameData::TypeMask typeMask = NodeMask) const |
| QSSGNodeIdList | getLayerNodes(quint32 layerMask, QSSGFrameData::TypeMask typeMask = NodeMask) const |
| QSSGRhiGraphicsPipelineState | getPipelineState() const |
| QSSGFrameData::Result | getRenderResult(QSSGFrameData::RenderResult id) const |
| QSSGFrameData::Result | getRenderResult(QSSGResourceId userPassId, QSSGFrameData::AttachmentSelector attachment) const |
(since 6.13) QRhiTexture * | getShaderImageTexture(QSSGResourceId shaderImageId) const |
(since 6.13) QRhiBuffer * | getShaderStorageBuffer(QSSGResourceId storageBufferId) const |
| void | scheduleRenderResults(QSSGFrameData::RenderResults results) const |
Detailed Description
Member Function Documentation
QSSGCameraId QSSGFrameData::activeCamera() const
Returns The active camera for the scene, or null if non could be found.
QSSGNodeIdList QSSGFrameData::getLayerNodes(QSSGCameraId cameraId, QSSGFrameData::TypeMask typeMask = NodeMask) const
Returns A list of layer nodes for the given cameraId that match the typeMask. If the camera does not have a layer mask, an empty list is returned.
QSSGNodeIdList QSSGFrameData::getLayerNodes(quint32 layerMask, QSSGFrameData::TypeMask typeMask = NodeMask) const
Returns A list of layer nodes that match the layerMask and typeMask.
QSSGRhiGraphicsPipelineState QSSGFrameData::getPipelineState() const
Returns Base pipeline state for this frame
QSSGFrameData::Result QSSGFrameData::getRenderResult(QSSGFrameData::RenderResult id) const
Returns The renderable texture result from id. nullptr if no matching id was found.
Note: Even if the function returns a non-null result, the returned QSSGRhiRenderableTexture might not be ready unless the pass rendering to the texture has been executed.
Note: The returned value is only valid within the current frame. On each new frame the renderable will be reset and should therefore be queried again.
QSSGFrameData::Result QSSGFrameData::getRenderResult(QSSGResourceId userPassId, QSSGFrameData::AttachmentSelector attachment) const
Returns The renderable texture result from a user defined render pass with the given userPassId. If no matching user pass could be found, or if the user pass did not produce any renderable textures, an invalid Result is returned.
Note: Even if the function returns a non-null result, the returned QSSGRhiRenderableTexture might not be ready unless the pass rendering to the texture has been executed.
Note: The returned value is only valid within the current frame. On each new frame the renderable will be reset and should therefore be queried again.
[since 6.13] QRhiTexture *QSSGFrameData::getShaderImageTexture(QSSGResourceId shaderImageId) const
Returns The texture backing the ShaderImage with the given shaderImageId, or nullptr if there is none.
Use QQuick3DExtensionHelpers::getResourceId() to get the id of a ShaderImage.
The texture is created the first time the image is used in a window, for example by a ComputePass, RenderPass, CustomMaterial or Effect, so this function returns nullptr until then. The texture is shared by every View3D in the window, independent of which one uses it, and it is recreated when the size or format of the image changes. The returned texture is therefore only valid within the current frame and should be queried again on each new frame.
Note: Even if the function returns a texture, its content is only what the passes using it have written so far. To see what a ComputePass in the same View3D wrote this frame, read the texture from an extension that runs after the user passes, such as one with the Main render mode and the PostColor render stage. The order in which different View3Ds are rendered is not defined.
This function was introduced in Qt 6.13.
See also getShaderStorageBuffer().
[since 6.13] QRhiBuffer *QSSGFrameData::getShaderStorageBuffer(QSSGResourceId storageBufferId) const
Returns The buffer backing the ShaderStorageBuffer with the given storageBufferId, or nullptr if there is none.
Use QQuick3DExtensionHelpers::getResourceId() to get the id of a ShaderStorageBuffer.
If the ShaderStorageBuffer has a buffer provider that has registered a buffer with QSSGRenderExtensionHelpers::registerRenderResultBuffer(), that buffer is returned. Otherwise the buffer is the one the engine creates the first time the ShaderStorageBuffer is used in a window, and this function returns nullptr until then.
The same rules as for getShaderImageTexture() apply: the buffer is shared by every View3D in the window, it can be recreated when the ShaderStorageBuffer changes, and it should be queried again on each new frame.
This function was introduced in Qt 6.13.
See also getShaderImageTexture().
void QSSGFrameData::scheduleRenderResults(QSSGFrameData::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 QSSGRenderExtension::prepareData().
Note: The requested results might not be available if the underlying layer does not support them or if the layer does not contain any data that would make it necessary to produce the requested results, in which case getRenderResult() will return a empty result.
See also getRenderResult().