29 Q_PROPERTY(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> commands READ commands FINAL)
30 Q_PROPERTY(QUrl computeShader READ computeShader WRITE setComputeShader NOTIFY computeShaderChanged FINAL)
31 Q_PROPERTY(ExecutionMode executionMode READ executionMode WRITE setExecutionMode NOTIFY executionModeChanged FINAL)
32 Q_PROPERTY(ExecutionStage executionStage READ executionStage WRITE setExecutionStage NOTIFY executionStageChanged FINAL)
33 QML_NAMED_ELEMENT(ComputePass)
34 QML_ADDED_IN_VERSION(6, 13)
46 Q_ENUM(ExecutionStage)
48 explicit QQuick3DComputePass(QQuick3DObject *parent =
nullptr);
50 QQmlListProperty<QQuick3DShaderUtilsRenderCommand> commands();
52 QUrl computeShader()
const;
53 ExecutionMode executionMode()
const;
54 ExecutionStage executionStage()
const;
56 Q_INVOKABLE
void requestExecution();
59 void setComputeShader(
const QUrl &computeShader);
60 void setExecutionMode(ExecutionMode executionMode);
61 void setExecutionStage(ExecutionStage executionStage);
64 void computeShaderChanged();
65 void executionModeChanged();
66 void executionStageChanged();
69 void onShaderResourceDirty();
72 void markAllDirty() override { m_dirtyAttributes = AllDirty; }
73 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
74 void itemChange(QQuick3DObject::ItemChange,
const QQuick3DObject::ItemChangeData &) override;
75 void markTrackedPropertyDirty(QMetaProperty property, QQuick3DPropertyChangedTracker::DirtyPropertyHint hint) override;
78 static void qmlAppendCommand(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list, QQuick3DShaderUtilsRenderCommand *command);
79 static QQuick3DShaderUtilsRenderCommand *qmlCommandAt(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list, qsizetype index);
80 static qsizetype qmlCommandCount(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list);
81 static void qmlCommandClear(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list);
83 void onCommandChanged();
84 void markResourcesDirty();
90 ComputeShaderDirty = 0x8,
94 using DirtyT = std::underlying_type_t<Dirty>;
95 static constexpr DirtyT AllDirty { std::numeric_limits<DirtyT>::max() };
97 void markDirty(QQuick3DComputePass::DirtyT type,
bool requestSecondaryUpdate =
false);
98 void clearDirty(QQuick3DComputePass::DirtyT type);
100 quint32 m_dirtyAttributes = AllDirty;
101 QVector<QQuick3DShaderUtilsRenderCommand *> m_commands;
102 QUrl m_computeShader;
103 ExecutionMode m_executionMode = EveryFrame;
104 ExecutionStage m_executionStage = PreColor;
105 quint64 m_executionSerial = 1;
106 QQuick3DShaderResourceTracker m_shaderResources {
this, [
this]() { markResourcesDirty(); } };
friend class QSSGLayerRenderData
Q_TRACE_POINT(qtquick3d, QSSG_synchronize_entry, QQuick3DViewport *view3D, const QSize &size, float dpr)