96 Q_PROPERTY(TextureFormat format READ format WRITE setFormat NOTIFY changed)
97 Q_PROPERTY(TextureFilterOperation textureFilterOperation READ textureFilterOperation WRITE setTextureFilterOperation NOTIFY changed)
98 Q_PROPERTY(TextureCoordOperation textureCoordOperation READ textureCoordOperation WRITE setTextureCoordOperation NOTIFY changed)
99 Q_PROPERTY(
float sizeMultiplier MEMBER sizeMultiplier NOTIFY changed)
100 Q_PROPERTY(AllocateBufferFlagValues bufferFlags READ bufferFlags WRITE setBufferFlags NOTIFY changed)
101 Q_PROPERTY(QByteArray name MEMBER name NOTIFY changed)
103 QML_NAMED_ELEMENT(Buffer)
106 QQuick3DShaderUtilsBuffer() =
default;
107 ~QQuick3DShaderUtilsBuffer() override =
default;
109 enum class TextureFilterOperation
115 Q_ENUM(TextureFilterOperation)
117 enum class TextureCoordOperation
124 Q_ENUM(TextureCoordOperation)
126 enum class AllocateBufferFlagValues
131 Q_ENUM(AllocateBufferFlagValues)
133 enum class TextureFormat {
143 Q_ENUM(TextureFormat)
145 QSSGAllocateBuffer command {};
146 TextureFilterOperation textureFilterOperation()
const {
return TextureFilterOperation(command.m_filterOp); }
147 void setTextureFilterOperation(TextureFilterOperation op);
149 TextureCoordOperation textureCoordOperation()
const {
return TextureCoordOperation(command.m_texCoordOp); }
150 void setTextureCoordOperation(TextureCoordOperation texCoordOp);
151 float &sizeMultiplier = command.m_sizeMultiplier;
152 QSSGCommand *cloneCommand() {
return new QSSGAllocateBuffer(command); }
154 TextureFormat format()
const;
155 void setFormat(TextureFormat format);
157 AllocateBufferFlagValues bufferFlags()
const {
return AllocateBufferFlagValues(
int(command.m_bufferFlags)); }
158 void setBufferFlags(AllocateBufferFlagValues flag);
160 QByteArray &name = command.m_name;
162 static QSSGRenderTextureFormat::Format mapTextureFormat(QQuick3DShaderUtilsBuffer::TextureFormat fmt);
163 static QQuick3DShaderUtilsBuffer::TextureFormat mapRenderTextureFormat(QSSGRenderTextureFormat::Format fmt);
189 Q_PROPERTY(QQuick3DShaderUtilsBuffer *buffer READ buffer WRITE setBuffer)
190 Q_PROPERTY(QByteArray sampler MEMBER sampler)
192 QML_NAMED_ELEMENT(BufferInput)
195 QQuick3DShaderUtilsBufferInput() =
default;
196 ~QQuick3DShaderUtilsBufferInput() override =
default;
197 QSSGApplyBufferValue command { QByteArray(), QByteArray() };
198 QByteArray &sampler = command.m_samplerName;
199 QSSGCommand *cloneCommand() override {
return new QSSGApplyBufferValue(command); }
201 int bufferCount()
const override {
return (m_buffer !=
nullptr) ? 1 : 0; }
202 QQuick3DShaderUtilsBuffer *bufferAt(
int idx)
const override
204 Q_ASSERT(idx < 1 && idx >= 0);
205 return (m_buffer && idx == 0) ? m_buffer :
nullptr;
208 QQuick3DShaderUtilsBuffer *buffer()
const {
return m_buffer; }
209 void setBuffer(QQuick3DShaderUtilsBuffer *buffer) {
210 if (m_buffer == buffer)
214 Q_ASSERT(!buffer->name.isEmpty());
215 command.m_bufferName = buffer->name;
220 QQuick3DShaderUtilsBuffer *m_buffer =
nullptr;
227 Q_PROPERTY(
bool enable MEMBER enable)
228 Q_PROPERTY(ColorMask colorWrite MEMBER colorWrite)
229 Q_PROPERTY(BlendFactor srcColor MEMBER srcColor)
230 Q_PROPERTY(BlendFactor dstColor MEMBER dstColor)
231 Q_PROPERTY(BlendOperation opColor MEMBER opColor)
232 Q_PROPERTY(BlendFactor srcAlpha MEMBER srcAlpha)
233 Q_PROPERTY(BlendFactor dstAlpha MEMBER dstAlpha)
234 Q_PROPERTY(BlendOperation opAlpha MEMBER opAlpha)
235 QML_VALUE_TYPE(renderTargetBlend)
236 QML_ADDED_IN_VERSION(6, 11)
239 enum ColorMaskComponent : quint32 {
245 Q_DECLARE_FLAGS(ColorMask, ColorMaskComponent)
247 enum class BlendFactor {
259 OneMinusConstantColor,
261 OneMinusConstantAlpha,
270 enum class BlendOperation {
277 Q_ENUM(BlendOperation)
279 ColorMask colorWrite = ColorMask(0xF);
281 BlendFactor srcColor = BlendFactor::One;
282 BlendFactor dstColor = BlendFactor::OneMinusSrcAlpha;
283 BlendOperation opColor = BlendOperation::Add;
284 BlendFactor srcAlpha = BlendFactor::One;
285 BlendFactor dstAlpha = BlendFactor::OneMinusSrcAlpha;
286 BlendOperation opAlpha = BlendOperation::Add;
288 bool operator==(
const QQuick3DRenderPassTargetBlend &other)
const
290 return colorWrite == other.colorWrite
291 && enable == other.enable
292 && srcColor == other.srcColor
293 && dstColor == other.dstColor
294 && opColor == other.opColor
295 && srcAlpha == other.srcAlpha
296 && dstAlpha == other.dstAlpha
297 && opAlpha == other.opAlpha;
300 QQuick3DRenderPassTargetBlend() =
default;
301 QQuick3DRenderPassTargetBlend(QRhiGraphicsPipeline::TargetBlend targetBlend)
302 : colorWrite(ColorMask(targetBlend.colorWrite.toInt()))
303 , enable(targetBlend.enable)
304 , srcColor(BlendFactor(targetBlend.srcColor))
305 , dstColor(BlendFactor(targetBlend.dstColor))
306 , opColor(BlendOperation(targetBlend.opColor))
307 , srcAlpha(BlendFactor(targetBlend.srcAlpha))
308 , dstAlpha(BlendFactor(targetBlend.dstAlpha))
309 , opAlpha(BlendOperation(targetBlend.opAlpha))
313 QRhiGraphicsPipeline::TargetBlend toRhiTargetBlend()
const
315 QRhiGraphicsPipeline::TargetBlend tb;
316 tb.colorWrite = QRhiGraphicsPipeline::ColorMask(colorWrite.toInt());
318 tb.srcColor = QRhiGraphicsPipeline::BlendFactor(
int(srcColor));
319 tb.dstColor = QRhiGraphicsPipeline::BlendFactor(
int(dstColor));
320 tb.opColor = QRhiGraphicsPipeline::BlendOp(
int(opColor));
321 tb.srcAlpha = QRhiGraphicsPipeline::BlendFactor(
int(srcAlpha));
322 tb.dstAlpha = QRhiGraphicsPipeline::BlendFactor(
int(dstAlpha));
323 tb.opAlpha = QRhiGraphicsPipeline::BlendOp(
int(opAlpha));
339 Q_PROPERTY(
bool depthTestEnabled READ depthTestEnabled WRITE setDepthTestEnabled RESET resetDepthTestEnabled NOTIFY depthTestEnabledChanged)
340 Q_PROPERTY(
bool depthWriteEnabled READ depthWriteEnabled WRITE setDepthWriteEnabled RESET resetDepthWriteEnabled NOTIFY depthWriteEnabledChanged)
341 Q_PROPERTY(
bool blendEnabled READ blendEnabled WRITE setBlendEnabled RESET resetBlendEnabled NOTIFY blendEnabledChanged FINAL)
342 Q_PROPERTY(
bool usesStencilReference READ usesStencilReference WRITE setUsesStencilReference RESET resetUsesStencilReference NOTIFY usesStencilReferenceChanged)
343 Q_PROPERTY(
bool usesScissor READ usesScissor WRITE setUsesScissor RESET resetUsesScissor NOTIFY usesScissorChanged)
344 Q_PROPERTY(CompareOperation depthFunction READ depthFunction WRITE setDepthFunction RESET resetDepthFunction NOTIFY depthFunctionChanged)
345 Q_PROPERTY(CullMode cullMode READ cullMode WRITE setCullMode RESET resetCullMode NOTIFY cullModeChanged)
346 Q_PROPERTY(PolygonMode polygonMode READ polygonMode WRITE setPolygonMode RESET resetPolygonMode NOTIFY polygonModeChanged)
347 Q_PROPERTY(quint32 stencilWriteMask READ stencilWriteMask WRITE setStencilWriteMask RESET resetStencilWriteMask NOTIFY stencilWriteMaskChanged)
348 Q_PROPERTY(quint32 stencilReference READ stencilReference WRITE setStencilReference RESET resetStencilReference NOTIFY stencilReferenceChanged)
349 Q_PROPERTY(QRectF viewport READ viewport WRITE setViewport RESET resetViewport NOTIFY viewportChanged)
350 Q_PROPERTY(QRect scissor READ scissor WRITE setScissor RESET resetScissor NOTIFY scissorChanged)
351 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend0 READ targetBlend0 WRITE setTargetBlend0 RESET resetTargetBlend0 NOTIFY targetBlend0Changed)
352 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend1 READ targetBlend1 WRITE setTargetBlend1 RESET resetTargetBlend1 NOTIFY targetBlend1Changed)
353 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend2 READ targetBlend2 WRITE setTargetBlend2 RESET resetTargetBlend2 NOTIFY targetBlend2Changed)
354 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend3 READ targetBlend3 WRITE setTargetBlend3 RESET resetTargetBlend3 NOTIFY targetBlend3Changed)
355 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend4 READ targetBlend4 WRITE setTargetBlend4 RESET resetTargetBlend4 NOTIFY targetBlend4Changed)
356 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend5 READ targetBlend5 WRITE setTargetBlend5 RESET resetTargetBlend5 NOTIFY targetBlend5Changed)
357 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend6 READ targetBlend6 WRITE setTargetBlend6 RESET resetTargetBlend6 NOTIFY targetBlend6Changed)
358 Q_PROPERTY(QQuick3DRenderPassTargetBlend targetBlend7 READ targetBlend7 WRITE setTargetBlend7 RESET resetTargetBlend7 NOTIFY targetBlend7Changed)
359 QML_NAMED_ELEMENT(PipelineStateOverride)
360 QML_ADDED_IN_VERSION(6, 11)
363 enum class CompareOperation {
373 Q_ENUM(CompareOperation)
375 enum class CullMode {
382 enum class PolygonMode {
388 QQuick3DShaderUtilsPipelineStateOverride();
389 ~QQuick3DShaderUtilsPipelineStateOverride() override;
391 bool depthTestEnabled()
const;
392 void setDepthTestEnabled(
bool newDepthTestEnabled);
393 void resetDepthTestEnabled();
394 bool depthWriteEnabled()
const;
395 void setDepthWriteEnabled(
bool newDepthWriteEnabled);
396 void resetDepthWriteEnabled();
398 bool blendEnabled()
const;
399 void setBlendEnabled(
bool newBlendEnabled);
400 void resetBlendEnabled();
402 bool usesStencilReference()
const;
403 void setUsesStencilReference(
bool newUsesStencilReference);
404 void resetUsesStencilReference();
406 bool usesScissor()
const;
407 void setUsesScissor(
bool newUsesScissor);
408 void resetUsesScissor();
410 CompareOperation depthFunction()
const;
411 void setDepthFunction(CompareOperation newDepthFunction);
412 void resetDepthFunction();
414 CullMode cullMode()
const;
415 void setCullMode(CullMode newCullMode);
416 void resetCullMode();
418 PolygonMode polygonMode()
const;
419 void setPolygonMode(PolygonMode newPolygonMode);
420 void resetPolygonMode();
422 quint32 stencilWriteMask()
const;
423 void setStencilWriteMask(quint32 newStencilWriteMask);
424 void resetStencilWriteMask();
426 quint32 stencilReference()
const;
427 void setStencilReference(quint32 newStencilReference);
428 void resetStencilReference();
430 QRectF viewport()
const;
431 void setViewport(
const QRectF &newViewport);
432 void resetViewport();
434 QRect scissor()
const;
435 void setScissor(
const QRect &newScissor);
438 QQuick3DRenderPassTargetBlend targetBlend0()
const;
439 void setTargetBlend0(
const QQuick3DRenderPassTargetBlend &newTargetBlend0);
440 void resetTargetBlend0();
442 QQuick3DRenderPassTargetBlend targetBlend1()
const;
443 void setTargetBlend1(
const QQuick3DRenderPassTargetBlend &newTargetBlend1);
444 void resetTargetBlend1();
446 QQuick3DRenderPassTargetBlend targetBlend2()
const;
447 void setTargetBlend2(
const QQuick3DRenderPassTargetBlend &newTargetBlend2);
448 void resetTargetBlend2();
450 QQuick3DRenderPassTargetBlend targetBlend3()
const;
451 void setTargetBlend3(
const QQuick3DRenderPassTargetBlend &newTargetBlend3);
452 void resetTargetBlend3();
454 QQuick3DRenderPassTargetBlend targetBlend4()
const;
455 void setTargetBlend4(
const QQuick3DRenderPassTargetBlend &newTargetBlend4);
456 void resetTargetBlend4();
458 QQuick3DRenderPassTargetBlend targetBlend5()
const;
459 void setTargetBlend5(
const QQuick3DRenderPassTargetBlend &newTargetBlend5);
460 void resetTargetBlend5();
462 QQuick3DRenderPassTargetBlend targetBlend6()
const;
463 void setTargetBlend6(
const QQuick3DRenderPassTargetBlend &newTargetBlend6);
464 void resetTargetBlend6();
466 QQuick3DRenderPassTargetBlend targetBlend7()
const;
467 void setTargetBlend7(
const QQuick3DRenderPassTargetBlend &newTargetBlend7);
468 void resetTargetBlend7();
471 void depthTestEnabledChanged();
472 void depthWriteEnabledChanged();
473 void blendEnabledChanged();
474 void usesStencilReferenceChanged();
475 void usesScissorChanged();
476 void depthFunctionChanged();
477 void cullModeChanged();
478 void polygonModeChanged();
479 void stencilWriteMaskChanged();
480 void stencilReferenceChanged();
481 void viewportChanged();
482 void scissorChanged();
483 void targetBlend0Changed();
484 void targetBlend1Changed();
485 void targetBlend2Changed();
486 void targetBlend3Changed();
487 void targetBlend4Changed();
488 void targetBlend5Changed();
489 void targetBlend6Changed();
490 void targetBlend7Changed();
493 QSSGCommand *cloneCommand() override {
return new QSSGPipelineStateOverrideCommand(command); }
494 QSSGPipelineStateOverrideCommand command { };
519 Q_PROPERTY(quint32 layerMask MEMBER layerMask)
520 Q_PROPERTY(RenderableTypes renderableTypes READ renderableTypes WRITE setRenderableTypes)
521 QML_NAMED_ELEMENT(RenderablesFilter)
522 QML_ADDED_IN_VERSION(6, 11)
525 enum class RenderableType : quint32 {
530 Q_DECLARE_FLAGS(RenderableTypes, RenderableType)
531 Q_FLAG(RenderableTypes)
533 QQuick3DShaderUtilsRenderablesFilter() =
default;
534 ~QQuick3DShaderUtilsRenderablesFilter() override;
536 RenderableTypes renderableTypes()
const;
537 void setRenderableTypes(RenderableTypes types);
539 QSSGCommand *cloneCommand() override {
return new QSSGRenderablesFilterCommand(command); }
540 QSSGRenderablesFilterCommand command { };
542 quint32 &layerMask = command.layerMask;
592 Q_PROPERTY(QQuick3DShaderUtilsRenderPassTexture *target READ target WRITE setTarget)
593 Q_PROPERTY(QByteArray name READ name WRITE setName FINAL)
594 QML_NAMED_ELEMENT(ColorAttachment)
595 QML_ADDED_IN_VERSION(6, 11)
598 QQuick3DShaderUtilsRenderPassColorAttachment() =
default;
599 ~QQuick3DShaderUtilsRenderPassColorAttachment() override;
601 QByteArray name()
const;
602 void setName(
const QByteArray &newName);
604 QQuick3DShaderUtilsRenderPassTexture *target()
const {
return m_target; }
605 void setTarget(QQuick3DShaderUtilsRenderPassTexture *target);
607 QSSGCommand *cloneCommand() override;
610 void itemChange(ItemChange change,
const ItemChangeData &value) override;
613 void updateSceneManager(QQuick3DSceneManager *sceneManager);
615 QQuick3DShaderUtilsRenderPassTexture *m_target =
nullptr;
622 Q_PROPERTY(QQuick3DShaderUtilsRenderPassTexture *target READ target WRITE setTarget)
623 QML_NAMED_ELEMENT(DepthTextureAttachment)
624 QML_ADDED_IN_VERSION(6, 11)
627 QQuick3DShaderUtilsRenderPassDepthTextureAttachment() =
default;
628 ~QQuick3DShaderUtilsRenderPassDepthTextureAttachment() override;
630 QQuick3DShaderUtilsRenderPassTexture *target()
const {
return m_target; }
631 void setTarget(QQuick3DShaderUtilsRenderPassTexture *target);
633 QSSGCommand *cloneCommand() override;
636 void itemChange(ItemChange change,
const ItemChangeData &value) override;
639 void updateSceneManager(QQuick3DSceneManager *sceneManager);
641 QQuick3DShaderUtilsRenderPassTexture *m_target =
nullptr;
688 Q_PROPERTY(QQuick3DRenderPass *renderPass READ renderPass WRITE setRenderPass NOTIFY renderPassChanged FINAL)
689 QML_NAMED_ELEMENT(SubRenderPass)
690 QML_ADDED_IN_VERSION(6, 11)
693 QQuick3DShaderUtilsSubRenderPass() =
default;
694 ~QQuick3DShaderUtilsSubRenderPass() override;
696 QQuick3DRenderPass *renderPass()
const;
697 void setRenderPass(QQuick3DRenderPass *newRenderPass);
699 QSSGCommand *cloneCommand() override;
702 void renderPassChanged();
705 virtual QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) final;
706 virtual void itemChange(ItemChange change,
const ItemChangeData &value) final;
709 void updateSceneManager(QQuick3DSceneManager *sceneManager);
711 QPointer<QQuick3DRenderPass> m_renderPass;
712 mutable bool m_hasWarnedAboutInvalidId =
false;
718 Q_PROPERTY(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> commands READ commands FINAL)
719 Q_PROPERTY(QQuick3DShaderUtilsBuffer *output MEMBER outputBuffer)
720 Q_PROPERTY(QQmlListProperty<QQuick3DShaderUtilsShader> shaders READ shaders)
721 QML_NAMED_ELEMENT(Pass)
722 QML_ADDED_IN_VERSION(6, 11)
725 QQuick3DShaderUtilsRenderPass() =
default;
726 ~QQuick3DShaderUtilsRenderPass() override;
728 static void qmlAppendCommand(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list, QQuick3DShaderUtilsRenderCommand *command);
729 static QQuick3DShaderUtilsRenderCommand *qmlCommandAt(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list, qsizetype index);
730 static qsizetype qmlCommandCount(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list);
731 static void qmlCommandClear(QQmlListProperty<QQuick3DShaderUtilsRenderCommand> *list);
733 static void qmlAppendShader(QQmlListProperty<QQuick3DShaderUtilsShader> *list, QQuick3DShaderUtilsShader *shader);
734 static QQuick3DShaderUtilsShader *qmlShaderAt(QQmlListProperty<QQuick3DShaderUtilsShader> *list, qsizetype index);
735 static qsizetype qmlShaderCount(QQmlListProperty<QQuick3DShaderUtilsShader> *list);
736 static void qmlShaderClear(QQmlListProperty<QQuick3DShaderUtilsShader> *list);
738 QQmlListProperty<QQuick3DShaderUtilsRenderCommand> commands();
739 QVector<QQuick3DShaderUtilsRenderCommand *> m_commands;
740 QQuick3DShaderUtilsBuffer *outputBuffer =
nullptr;
741 QQmlListProperty<QQuick3DShaderUtilsShader> shaders();
742 QVarLengthArray<QQuick3DShaderUtilsShader *, 2> m_shaders;
806 enum class DirtyPropertyHint
813 explicit QQuick3DPropertyChangedTracker(QQuick3DObject *owner, QQuick3DSuperClassInfo<T> info)
815 , m_superClassName(info.superClassName())
817 Q_ASSERT(m_owner !=
nullptr);
819 virtual ~QQuick3DPropertyChangedTracker();
821 using UniformProperty = QSSGUserShaderAugmentation::Property;
822 using UniformPropertyList = QVector<UniformProperty>;
824 friend class QQuick3DPropertyWatcher;
827 QList<UniformProperty> extractProperties();
829 void addPropertyWatcher(QMetaProperty property, DirtyPropertyHint hint, QQuick3DObject *object =
nullptr);
830 void addDirtyProperty(
int pid);
831 void updateTrackedSceneManager(QQuick3DSceneManager *sceneManager);
833 virtual void markTrackedPropertyDirty(QMetaProperty property, DirtyPropertyHint hint) = 0;
837 QQuick3DPropertyWatcher *watcher =
nullptr;
838 QPointer<QQuick3DObject> object;
840 QPointer<QQuick3DSceneManager> sceneManager;
841 QMetaObject::Connection destroyedConnection;
844 QHash<
int, Tracked> m_trackedProperties;
845 QQuick3DObject *m_owner =
nullptr;
846 const char *m_superClassName =
nullptr;
847 QList<UniformProperty> m_propertyList;
855 QPointer<QQuick3DShaderUtilsTextureInput> textureInput;
856 QPointer<QQuick3DTexture> texture;
857 QMetaObject::Connection textureInputConnections[2];
858 QMetaObject::Connection textureConnections[2];
859 QMetaObject::Connection textureProviderConnection;
862 std::optional<UniformProperty> createOrUpdateTrackedProperty(
const QMetaProperty property,
bool addWatchers);
863 void markPropertyDirty(QMetaProperty property, DirtyPropertyHint hint);
864 void watchTextureInput(QMetaProperty property, QQuick3DShaderUtilsTextureInput *textureInput);
865 void watchTexture(QMetaProperty property, QQuick3DTexture *texture);
866 void watchTextureProvider(QMetaProperty property, QQuick3DTexture *texture);
868 QHash<
int, TextureWatch> m_textureWatchers;
869 std::vector<
int> m_dirtyProperties;
870 bool m_extracted =
false;
876 Q_PROPERTY(
int groupCountX READ groupCountX WRITE setGroupCountX NOTIFY groupCountXChanged FINAL)
877 Q_PROPERTY(
int groupCountY READ groupCountY WRITE setGroupCountY NOTIFY groupCountYChanged FINAL)
878 Q_PROPERTY(
int groupCountZ READ groupCountZ WRITE setGroupCountZ NOTIFY groupCountZChanged FINAL)
879 QML_NAMED_ELEMENT(Dispatch)
880 QML_ADDED_IN_VERSION(6, 13)
883 QQuick3DShaderUtilsCommandDispatch() =
default;
884 ~QQuick3DShaderUtilsCommandDispatch() override =
default;
885 int groupCountX()
const {
return m_groupCount.x; };
886 int groupCountY()
const {
return m_groupCount.y; };
887 int groupCountZ()
const {
return m_groupCount.z; };
888 QSSGCommand *cloneCommand() override;
890 void setGroupCountX(
int groupCountX);
891 void setGroupCountY(
int groupCountY);
892 void setGroupCountZ(
int groupCountZ);
894 void groupCountXChanged();
895 void groupCountYChanged();
896 void groupCountZChanged();
898 using ivec3 = QSSGRenderShaderValue::ivec3;
899 ivec3 m_groupCount = {1, 1, 1};
924 QQuick3DShaderResourceTracker(QQuick3DObject *owner, std::function<
void()> onResourceChanged);
925 ~QQuick3DShaderResourceTracker();
926 Q_DISABLE_COPY_MOVE(QQuick3DShaderResourceTracker)
928 static QQuick3DObject *resourceForProperty(
const QObject *owner,
const QMetaProperty &property,
929 bool *isResourceProperty =
nullptr);
931 void setResources(
const QHash<
int, QQuick3DObject *> &resources);
932 void trackProperties(
int firstPropertyIndex,
const QMetaMethod &onPropertyChanged);
933 QList<
int> resourceProperties()
const {
return m_resources.keys(); }
934 bool updateResources();
935 bool hasResourceLayoutChanged()
const;
936 void updateSceneManager(QQuick3DSceneManager *sceneManager);
942 QPointer<QQuick3DSceneManager> sceneManager;
943 QMetaObject::Connection destroyedConnection;
944 QMetaObject::Connection formatConnection;
945 QMetaObject::Connection shapeConnection;
948 void addReference(QQuick3DObject *object);
949 void removeReference(QQuick3DObject *object);
950 static QByteArray layoutKey(QQuick3DObject *object);
952 QQuick3DObject *m_owner =
nullptr;
953 std::function<
void()> m_onResourceChanged;
954 QHash<
int, QQuick3DObject *> m_resources;
955 QHash<
int, QByteArray> m_boundLayouts;
956 QHash<QQuick3DObject *, Reference> m_references;