Qt3DRender::QSetFence Class

class Qt3DRender::QSetFence

FrameGraphNode 用于在图形命令流中插入栅栏。更多

头文件: #include <QSetFence>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
继承: Qt3DRender::QFrameGraphNode
状态:已废弃

属性

公共功能

QVariant handle() const
Qt3DRender::QSetFence::HandleType handleType() const

信号

void handleChanged(QVariant handle)
void handleTypeChanged(Qt3DRender::QSetFence::HandleType handleType)

详细说明

栅栏允许同步 GPU 和 CPU 的工作负载。GPU 命令通常是非阻塞的。命令发出后会插入命令缓冲区,GPU 稍后会读取这些缓冲区。在某些情况下,只有在确定硬件已执行命令时,才能继续处理或发出特定命令。栅栏就是这样一种方法。这一点在使用 Qt3D 的第三方引擎时尤为重要,只有当我们知道其他引擎命令已完成对资源的修改时,Qt3D 才能访问共享资源。

QSetFence 是一个 FrameGraph 节点,用于在命令流中插入栅栏。它可以与QWaitFence 或通过提取底层句柄结合使用。

一旦呈现器创建了底层栅栏资源,句柄属性就会更新。只要处于无信号状态,句柄就会一直有效。一旦达到有信号状态,它就会被销毁,并创建一个新的句柄。这意味着,根据栅栏发出信号所需的时间,同一个句柄可以在多个帧中使用。

属性文档

[read-only] handle : const QVariant

将底层围栏手柄包裹在QVariant 中。

访问功能:

QVariant handle() const

通知信号:

void handleChanged(QVariant handle)

[read-only] handleType : const HandleType

指定正在使用的句柄类型。目前只支持 OpenGL 栅格 id。

访问功能:

Qt3DRender::QSetFence::HandleType handleType() const

Notifier 信号:

void handleTypeChanged(Qt3DRender::QSetFence::HandleType handleType)

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.