diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2018-06-20 12:26:04 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-06-25 04:39:31 +0000 |
commit | 785ae39b684229f28536f188aa806f4a07b4a427 (patch) | |
tree | 8e04ee8024a940bacd12e9df0303a9a6a761e5d0 | |
parent | f6a0587ef0a90f2e8333ea012aafdd956bca91f6 (diff) |
QGraphicsApiFilter: fix Vulkan enum value aliasing
Change-Id: I8c8583e318aef59c4fc280bc85ea6171538f53f3
Task-number: QTBUG-69028
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/materialsystem/qgraphicsapifilter.h | 8 | ||||
-rw-r--r-- | tests/auto/render/qgraphicsapifilter/tst_qgraphicsapifilter.cpp | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/render/materialsystem/qgraphicsapifilter.h b/src/render/materialsystem/qgraphicsapifilter.h index e3b132cbc..08b30b1f7 100644 --- a/src/render/materialsystem/qgraphicsapifilter.h +++ b/src/render/materialsystem/qgraphicsapifilter.h @@ -64,10 +64,10 @@ class QT3DRENDERSHARED_EXPORT QGraphicsApiFilter : public QObject public: enum Api { - OpenGLES = QSurfaceFormat::OpenGLES, - OpenGL = QSurfaceFormat::OpenGL, - Vulkan, - DirectX + OpenGLES = QSurfaceFormat::OpenGLES, // 2 + OpenGL = QSurfaceFormat::OpenGL, // 1 + Vulkan = 3, // 3 + DirectX // 4 }; Q_ENUM(Api) // LCOV_EXCL_LINE diff --git a/tests/auto/render/qgraphicsapifilter/tst_qgraphicsapifilter.cpp b/tests/auto/render/qgraphicsapifilter/tst_qgraphicsapifilter.cpp index 9e0cb8e57..bbc5219f8 100644 --- a/tests/auto/render/qgraphicsapifilter/tst_qgraphicsapifilter.cpp +++ b/tests/auto/render/qgraphicsapifilter/tst_qgraphicsapifilter.cpp @@ -242,6 +242,15 @@ private Q_SLOTS: QCOMPARE(isCompatible, expected); } + void checkEnumTypeValues() + { + // THEN + QCOMPARE(int(Qt3DRender::QGraphicsApiFilter::OpenGL), 1); + QCOMPARE(int(Qt3DRender::QGraphicsApiFilter::OpenGLES), 2); + QCOMPARE(int(Qt3DRender::QGraphicsApiFilter::Vulkan), 3); + QCOMPARE(int(Qt3DRender::QGraphicsApiFilter::DirectX), 4); + } + // TODO: Add equality test in 5.8 when we can add new api to // test for compatibility and properly use operator == to really // test for equality. |