diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-07 09:57:01 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-12 09:57:43 +0000 |
commit | 6df6c10e1af827d06a387e7422176dd310cf83be (patch) | |
tree | 4c343d4f30677147af5a8c64e2fdfc107c7f431f /src/plugins/scenegraph | |
parent | 51a7d0331ed430d0f81d02c1b690bd12da8fdb3b (diff) |
Fix enums in QSGGeometry
Minor fixes based on comments from the 5.8 API changes review:
Revert to using Qt-style enum values (POSITION -> PositionAttribute).
Use ByteType, FloatType, etc. instead of TypeByte, TypeFloat, ...
Add comments about magic GL values.
Add missing docs for Attribute::createWithAttributeType().
Change-Id: I1b8242efd3936f000ce8df6c11ff9ab7affb5713
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/scenegraph')
4 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp index fc3ea4e22e..3351486bc6 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp @@ -679,7 +679,7 @@ void QSGD3D12TextMaterial::populate(const QPointF &p, float glyphCacheInverseScaleX = 1.0 / glyphCacheScaleX; float glyphCacheInverseScaleY = 1.0 / glyphCacheScaleY; - Q_ASSERT(geometry->indexType() == QSGGeometry::TypeUnsignedShort); + Q_ASSERT(geometry->indexType() == QSGGeometry::UnsignedShortType); geometry->allocate(glyphIndexes.size() * 4, glyphIndexes.size() * 6); QVector4D *vp = reinterpret_cast<QVector4D *>(geometry->vertexDataAsTexturedPoint2D()); Q_ASSERT(geometry->sizeOfVertex() == sizeof(QVector4D)); diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp index 2644c693ce..a318ce23f7 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp @@ -585,31 +585,31 @@ QSGD3D12Format QSGD3D12Engine::toDXGIFormat(QSGGeometry::Type sgtype, int tupleS FmtFloat4 }; switch (sgtype) { - case QSGGeometry::TypeUnsignedByte: + case QSGGeometry::UnsignedByteType: format = formatMap_ub[tupleSize]; if (size) *size = tupleSize; break; - case QSGGeometry::TypeFloat: + case QSGGeometry::FloatType: format = formatMap_f[tupleSize]; if (size) *size = sizeof(float) * tupleSize; break; - case QSGGeometry::TypeUnsignedShort: + case QSGGeometry::UnsignedShortType: format = FmtUnsignedShort; if (size) *size = sizeof(ushort) * tupleSize; break; - case QSGGeometry::TypeUnsignedInt: + case QSGGeometry::UnsignedIntType: format = FmtUnsignedInt; if (size) *size = sizeof(uint) * tupleSize; break; - case QSGGeometry::TypeByte: - case QSGGeometry::TypeInt: - case QSGGeometry::TypeShort: + case QSGGeometry::ByteType: + case QSGGeometry::IntType: + case QSGGeometry::ShortType: qWarning("no mapping for GL type 0x%x", sgtype); break; diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp index ce633ae996..7f448ecd6f 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp @@ -718,7 +718,7 @@ void QSGD3D12Renderer::renderStencilClip(const QSGClipNode *clip, int elementInd const QSGGeometry *g = clip->geometry(); Q_ASSERT(g->attributeCount() == 1); Q_ASSERT(g->attributes()[0].tupleSize == 2); - Q_ASSERT(g->attributes()[0].type == QSGGeometry::TypeFloat); + Q_ASSERT(g->attributes()[0].type == QSGGeometry::FloatType); setInputLayout(g, &sps); m_engine->finalizePipeline(sps); diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12spritenode.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12spritenode.cpp index bad222dbaa..807fbcdcec 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12spritenode.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12spritenode.cpp @@ -166,8 +166,8 @@ QSGD3D12Material::UpdateResults QSGD3D12SpriteMaterial::updatePipeline(const QSG } static QSGGeometry::Attribute Sprite_Attributes[] = { - QSGGeometry::Attribute::createWithSemantic(0, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::POSITION), - QSGGeometry::Attribute::createWithSemantic(1, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::TEXCOORD), + QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType, QSGGeometry::PositionAttribute), + QSGGeometry::Attribute::createWithAttributeType(1, 2, QSGGeometry::FloatType, QSGGeometry::TexCoordAttribute), }; static QSGGeometry::AttributeSet Sprite_AttributeSet = { 2, 4 * sizeof(float), Sprite_Attributes }; |