From 84a017051693bab44a96f92fb4fd3f0c60264800 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 13 Jul 2021 19:23:39 +0200 Subject: Tracing/QmlProfiler: Prepare for porting of shaders to Qt 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change touches up the shader handling code in Tracing and QmlProfiler in order to pave the way for the pending porting of the shaders to Qt 6. - Use QSGGeometry::Attribute::createWithAttributeType instead of QSGGeometry::Attribute::create - Undefine some fields that are unused in Qt 6 - Add a couple of comments to document the relation between C++ variables and shader attributes - Extract some code into functions Change-Id: I0e7119484b6190a415a5c2d2a0bbd6465088cf19 Reviewed-by: Henning Gründl --- src/libs/tracing/timelineitemsrenderpass.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libs/tracing/timelineitemsrenderpass.h') diff --git a/src/libs/tracing/timelineitemsrenderpass.h b/src/libs/tracing/timelineitemsrenderpass.h index 807f0ed5518..9d52be9ac71 100644 --- a/src/libs/tracing/timelineitemsrenderpass.h +++ b/src/libs/tracing/timelineitemsrenderpass.h @@ -48,7 +48,7 @@ public: #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QSGMaterialShader *createShader() const override; #else - QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override; + QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override; #endif // < Qt 6 private: @@ -83,8 +83,10 @@ public: static OpaqueColoredPoint2DWithSize *fromVertexData(QSGGeometry *geometry); private: - float x, y, w, h, id; - unsigned char r, g, b, a; + float x, y; // vec4 vertexCoord + float w, h; // vec2 rectSize + float id; // float selectionId + unsigned char r, g, b, a; // vec4 vertexColor void setCommon(const OpaqueColoredPoint2DWithSize *master); void setLeft(const OpaqueColoredPoint2DWithSize *master); -- cgit v1.2.3