diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-10-06 10:53:45 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-10-06 10:31:01 +0000 |
commit | ff5c83087e94f340a8c5695998f2ea81e29da8ea (patch) | |
tree | 257414475b3ed660f1bdeeab3226ddb2606208c7 | |
parent | d6358abf1719f920a7cadc85734c1ba520a52c25 (diff) |
D3D12: Fix some compiler warnings emitted by clang-cl
qsgd3d12renderer.cpp(72,7): warning: field 'm_renderList' will be initialized after field 'm_vboData' [-Wreorder]
qsgd3d12renderer.cpp(450,11): warning: 'scissorRect' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
qsgd3d12renderer.cpp(451,10): warning: 'scissorEnabled' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] ^
qsgd3d12renderer.cpp(452,9): warning: 'stencilValue' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
qsgd3d12renderer.cpp(453,10): warning: 'stencilEnabled' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
qsgd3d12builtinmaterials.cpp(463,7): warning: field 'm_font' will be initialized after field 'm_rc' [-Wreorder]
qsgd3d12shadereffectnode.cpp(174,32): warning: comparison of two values with different enumeration types ('QVariant::Type' and 'QMetaType::Type') [-Wenum-compare]
qsgd3d12engine.cpp(347,5): warning: delete called on non-final 'QSGD3D12EnginePrivate' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
qsgd3d12engine.cpp(2097,9): warning: variable 'topology' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
Change-Id: Id4179ccbe6f13c3068b445c2ae2a093a67851158
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
5 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp index 3351486bc6..312e8c19cd 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12builtinmaterials.cpp @@ -460,8 +460,8 @@ QSGD3D12Material::UpdateResults QSGD3D12SmoothTextureMaterial::updatePipeline(co QSGD3D12TextMaterial::QSGD3D12TextMaterial(StyleType styleType, QSGD3D12RenderContext *rc, const QRawFont &font, QFontEngine::GlyphFormat glyphFormat) : m_styleType(styleType), - m_font(font), - m_rc(rc) + m_rc(rc), + m_font(font) { setFlag(Blending, true); diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp index 908f1221ab..82bf9b0433 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp @@ -2077,7 +2077,7 @@ void QSGD3D12EnginePrivate::queueDraw(const QSGD3D12Engine::DrawParams ¶ms) ? buffers[indexBufIdx].d[currentPFrameIndex].buffer.Get() : nullptr; if (!skip && params.mode != tframeData.drawingMode) { - D3D_PRIMITIVE_TOPOLOGY topology; + D3D_PRIMITIVE_TOPOLOGY topology = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; switch (params.mode) { case QSGGeometry::DrawPoints: topology = D3D_PRIMITIVE_TOPOLOGY_POINTLIST; diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h b/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h index 1048ed63e7..a95cbb1cbb 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h +++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h @@ -105,6 +105,7 @@ public: struct DeviceLossObserver { virtual void deviceLost() = 0; + virtual ~DeviceLossObserver() = default; }; void registerDeviceLossObserver(DeviceLossObserver *observer); diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp index c0f111ee83..c38c616ae6 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp @@ -69,10 +69,10 @@ public: QSGD3D12Renderer::QSGD3D12Renderer(QSGRenderContext *context) : QSGRenderer(context), - m_renderList(16), m_vboData(1024), m_iboData(256), - m_cboData(4096) + m_cboData(4096), + m_renderList(16) { setNodeUpdater(new DummyUpdater); } @@ -447,10 +447,10 @@ void QSGD3D12Renderer::renderElements() struct RenderNodeState : public QSGRenderNode::RenderState { const QMatrix4x4 *projectionMatrix() const override { return m_projectionMatrix; } - QRect scissorRect() const { return m_scissorRect; } - bool scissorEnabled() const { return m_scissorEnabled; } - int stencilValue() const { return m_stencilValue; } - bool stencilEnabled() const { return m_stencilEnabled; } + QRect scissorRect() const override { return m_scissorRect; } + bool scissorEnabled() const override { return m_scissorEnabled; } + int stencilValue() const override { return m_stencilValue; } + bool stencilEnabled() const override { return m_stencilEnabled; } const QRegion *clipRegion() const override { return nullptr; } const QMatrix4x4 *m_projectionMatrix; diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp index 62771eb8f9..b4fb721a8b 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp @@ -171,7 +171,7 @@ void QSGD3D12ShaderLinker::linkTextureSubRects() // texture bind point. for (Constant &c : constants) { if (c.specialType == QSGShaderEffectNode::VariableData::SubRect) { - if (c.value.type() == QMetaType::QByteArray) { + if (c.value.type() == QVariant::ByteArray) { const QByteArray name = c.value.toByteArray(); if (!textureNameMap.contains(name)) qWarning("ShaderEffect: qt_SubRect_%s refers to unknown source texture", qPrintable(name)); |