diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:42:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-31 09:19:01 +0100 |
commit | 4c32d8f66280b8db9256f199afb2bae6b92ad7a5 (patch) | |
tree | 81d6ad319b4d48faba7f829054d1ef113ff465d4 | |
parent | ced895b361e4fff97f1b2d21e7f1bb33c82f34cd (diff) | |
parent | 294eefef0f8cfdba2edd73b5bd2ba7435b102ce5 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
.qmake.conf
src/render/backend/renderview.cpp
src/render/backend/renderview_p.h
Change-Id: I6c1122632f2c481da31a63e3abd42b760d1ff211
20 files changed, 482 insertions, 29 deletions
diff --git a/dist/changes-5.9.2 b/dist/changes-5.9.2 new file mode 100644 index 000000000..d8e1cb493 --- /dev/null +++ b/dist/changes-5.9.2 @@ -0,0 +1,39 @@ +Qt 5.9.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.9.2 Changes * +**************************************************************************** + +- Don't crash when removing clip animators +- Case-insensitive matching of DDS/PKM files [QTBUG-61760] +- Fix crash when using a single key frame +- Fix rendering glitches with 2D text +- Respect render target selector when reading pixel data back [QTBUG-61547] +- Fix memory leaks when loading multiple scenes with assimp [QTBUG-61856] +- Fix updates of some render states +- Fix sorting of render commands [QTBUG-60183] +- Fix assert crash when updating 3D content of a Scene3D item [QTBUG-60613] +- Fix crash when loading multiple assimp scenes +- Fix shader compilation on Rasp-Pi [QTBUG-59349] +- Don't deref null VAOs [QTBUG-59349] +- Respect byteStride in QAttribute +- Don't crash when rapidly changing textures +- Ignore ill-formed faces in OBJ files +- Many performance and memory use reduction changes diff --git a/examples/qt3d/widgets-scene3d/main.cpp b/examples/qt3d/widgets-scene3d/main.cpp index d306ed7b8..38eb46833 100644 --- a/examples/qt3d/widgets-scene3d/main.cpp +++ b/examples/qt3d/widgets-scene3d/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/animation/frontend/qanimationclip.cpp b/src/animation/frontend/qanimationclip.cpp index 7e7250021..2b04ce1ea 100644 --- a/src/animation/frontend/qanimationclip.cpp +++ b/src/animation/frontend/qanimationclip.cpp @@ -70,12 +70,18 @@ QAnimationClip::~QAnimationClip() { } +/*! + Returns the data describing the animation clip. +*/ QAnimationClipData QAnimationClip::clipData() const { Q_D(const QAnimationClip); return d->m_clipData; } +/*! + Set the parameters of the clip according to the \a clipData provided. +*/ void QAnimationClip::setClipData(const Qt3DAnimation::QAnimationClipData &clipData) { Q_D(QAnimationClip); diff --git a/src/input/frontend/qmousehandler.cpp b/src/input/frontend/qmousehandler.cpp index 9f30810a9..895cbc49a 100644 --- a/src/input/frontend/qmousehandler.cpp +++ b/src/input/frontend/qmousehandler.cpp @@ -60,7 +60,7 @@ QMouseHandlerPrivate::QMouseHandlerPrivate() m_shareable = false; m_pressAndHoldTimer->setSingleShot(true); m_pressAndHoldTimer->setInterval(500); - QObject::connect(m_pressAndHoldTimer.data(), &QTimer::timeout, [this] { + QObject::connect(m_pressAndHoldTimer, &QTimer::timeout, [this] { emit q_func()->pressAndHold(m_lastPressedEvent.data()); }); } diff --git a/src/input/frontend/qmousehandler_p.h b/src/input/frontend/qmousehandler_p.h index 3b2f2284d..6c7f8b204 100644 --- a/src/input/frontend/qmousehandler_p.h +++ b/src/input/frontend/qmousehandler_p.h @@ -74,7 +74,7 @@ public: QMouseDevice *m_mouseDevice; bool m_containsMouse; - QScopedPointer<QTimer> m_pressAndHoldTimer; + QTimer *m_pressAndHoldTimer = nullptr; QMouseEventPtr m_lastPressedEvent; void mouseEvent(const QMouseEventPtr &event); diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp index 1ba178a3a..eb64677c1 100644 --- a/src/render/backend/renderer.cpp +++ b/src/render/backend/renderer.cpp @@ -1768,7 +1768,8 @@ bool Renderer::executeCommandsSubmission(const RenderView *rv) { Profiling::GLTimeRecorder recorder(Profiling::UniformUpdate); //// Update program uniforms - m_graphicsContext->setParameters(command->m_parameterPack); + if (!m_graphicsContext->setParameters(command->m_parameterPack)) + allCommandsIssued = false; } //// OpenGL State diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp index c0d3c983c..572cda229 100644 --- a/src/render/backend/renderview.cpp +++ b/src/render/backend/renderview.cpp @@ -572,7 +572,12 @@ QVector<RenderCommand *> RenderView::buildDrawRenderCommands(const QVector<Entit for (const RenderPassParameterData &passData : renderPassData) { // Add the RenderPass Parameters RenderCommand *command = new RenderCommand(); - command->m_depth = m_data.m_eyePos.distanceToPoint(entity->worldBoundingVolume()->center()); + + // Project the camera-to-object-center vector onto the camera + // view vector. This gives a depth value suitable as the key + // for BackToFront sorting. + command->m_depth = QVector3D::dotProduct(entity->worldBoundingVolume()->center() - m_data.m_eyePos, m_data.m_eyeViewDir); + command->m_geometry = geometryHandle; command->m_geometryRenderer = geometryRendererHandle; command->m_material = materialHandle; @@ -731,6 +736,12 @@ void RenderView::updateMatrices() const QMatrix4x4 inverseWorldTransform = viewMatrix().inverted(); const QVector3D eyePosition(inverseWorldTransform.column(3)); setEyePosition(eyePosition); + + // Get the viewing direction of the camera. Use the normal matrix to + // ensure non-uniform scale works too. + QMatrix3x3 normalMat = m_data.m_viewMatrix.normalMatrix(); + // dir = normalize(QVector3D(0, 0, -1) * normalMat) + setEyeViewDirection(QVector3D(-normalMat(2, 0), -normalMat(2, 1), -normalMat(2, 2)).normalized()); } } diff --git a/src/render/backend/renderview_p.h b/src/render/backend/renderview_p.h index e5ac02095..21d25a528 100644 --- a/src/render/backend/renderview_p.h +++ b/src/render/backend/renderview_p.h @@ -162,6 +162,9 @@ public: inline void setEyePosition(const QVector3D &eyePos) Q_DECL_NOTHROW { m_data.m_eyePos = eyePos; } inline QVector3D eyePosition() const Q_DECL_NOTHROW { return m_data.m_eyePos; } + inline void setEyeViewDirection(const QVector3D &dir) Q_DECL_NOTHROW { m_data.m_eyeViewDir = dir; } + inline QVector3D eyeViewDirection() const Q_DECL_NOTHROW { return m_data.m_eyeViewDir; } + inline void appendLayerFilter(const Qt3DCore::QNodeId layerFilterId) Q_DECL_NOTHROW { m_data.m_layerFilterIds.push_back(layerFilterId); } inline Qt3DCore::QNodeIdVector layerFilters() const Q_DECL_NOTHROW { return m_data.m_layerFilterIds; } @@ -262,6 +265,7 @@ public: Qt3DCore::QNodeIdVector m_layerFilterIds; QVector<Qt3DRender::QSortPolicy::SortType> m_sortingTypes; QVector3D m_eyePos; + QVector3D m_eyeViewDir; Qt3DCore::QNodeIdVector m_proximityFilterIds; }; diff --git a/src/render/framegraph/qbuffercapture.cpp b/src/render/framegraph/qbuffercapture.cpp index 602ad5d6d..d1d301077 100644 --- a/src/render/framegraph/qbuffercapture.cpp +++ b/src/render/framegraph/qbuffercapture.cpp @@ -58,6 +58,11 @@ QBufferCapturePrivate::QBufferCapturePrivate() } +/*! + \class Qt3DRender::QBufferCapture + \inmodule Qt3DRender + \brief Exchanges buffer data between GPU and CPU. +*/ QBufferCapture::QBufferCapture(Qt3DCore::QNode *parent) : QFrameGraphNode(*new QBufferCapturePrivate, parent) { diff --git a/src/render/framegraph/qframegraphnodecreatedchange.cpp b/src/render/framegraph/qframegraphnodecreatedchange.cpp index 1f04a099d..ef51d5228 100644 --- a/src/render/framegraph/qframegraphnodecreatedchange.cpp +++ b/src/render/framegraph/qframegraphnodecreatedchange.cpp @@ -48,6 +48,12 @@ QFrameGraphNodeCreatedChangeBasePrivate::QFrameGraphNodeCreatedChangeBasePrivate { } +/*! + \class Qt3DRender::QFrameGraphNodeCreatedChangeBase + \inmodule Qt3DRender + + \brief A base class for changes in the FrameGraphNode. +*/ QFrameGraphNodeCreatedChangeBase::QFrameGraphNodeCreatedChangeBase(const QFrameGraphNode *node) : Qt3DCore::QNodeCreatedChangeBase(*new QFrameGraphNodeCreatedChangeBasePrivate(node), node) { diff --git a/src/render/framegraph/qsortpolicy.cpp b/src/render/framegraph/qsortpolicy.cpp index b1e0f4956..e5a6e096c 100644 --- a/src/render/framegraph/qsortpolicy.cpp +++ b/src/render/framegraph/qsortpolicy.cpp @@ -88,10 +88,20 @@ QSortPolicyPrivate::QSortPolicyPrivate() /*! \enum QSortPolicy::SortType - This enum type describes sort types that can be employed - \value StateChangeCost sort the objects so as to minimize the cost of changing from the currently rendered state - \value BackToFront sort the objects from back to front inverted z order + This enum type describes the available sort types. + + \value StateChangeCost sort the objects so as to minimize the cost of + changing from the currently rendered state + + \value BackToFront sort the objects from back to front based on inverted z + order. More accurately, the sorting key is the z component of the + projection of the camera-to-object-center vector onto the camera's view + vector. + \value Material sort the objects based on their material value + + \value FrontToBack sort the objects from front to back. The opposite of + BackToFront. */ /*! diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp index 814429504..9a20c77e7 100644 --- a/src/render/graphicshelpers/graphicscontext.cpp +++ b/src/render/graphicshelpers/graphicscontext.cpp @@ -1175,10 +1175,11 @@ void GraphicsContext::setRenderer(Renderer *renderer) // It will be easier if the QGraphicContext applies the QUniformPack // than the other way around -void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) +bool GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) { // Activate textures and update TextureUniform in the pack // with the correct textureUnit + bool allValid = true; // Set the pinned texture of the previous material texture // to pinable so that we should easily find an available texture unit @@ -1198,6 +1199,10 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) Q_ASSERT(texUniform.valueType() == UniformValue::TextureValue); const int texUnit = activateTexture(TextureScopeMaterial, t); texUniform.data<UniformValue::Texture>()->textureId = texUnit; + // if the texture data from generators may not be available yet, + // make sure that the next frame is rendered + if (texUnit == -1) + allValid = false; } } } @@ -1218,11 +1223,6 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) // be bound as a VertexArray bindGLBuffer(ssbo, GLBuffer::ShaderStorageBuffer); ssbo->bindBufferBase(this, ssboIndex++, GLBuffer::ShaderStorageBuffer); - // Perform update if required - if (cpuBuffer->isDirty()) { - uploadDataToGLBuffer(cpuBuffer, ssbo); - cpuBuffer->unsetDirty(); - } // TO DO: Make sure that there's enough binding points } @@ -1238,11 +1238,6 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) // be bound as a VertexArray bindGLBuffer(ubo, GLBuffer::UniformBuffer); ubo->bindBufferBase(this, uboIndex++, GLBuffer::UniformBuffer); - if (cpuBuffer->isDirty()) { - // Perform update if required - uploadDataToGLBuffer(cpuBuffer, ubo); - cpuBuffer->unsetDirty(); - } // TO DO: Make sure that there's enough binding points } @@ -1262,6 +1257,8 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) applyUniform(uniform, v); } + // if not all data is valid, the next frame will be rendered immediately + return allValid; } void GraphicsContext::readBuffer(GLenum mode) diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h index 1b9438a6f..b07a11c7e 100644 --- a/src/render/graphicshelpers/graphicscontext_p.h +++ b/src/render/graphicshelpers/graphicscontext_p.h @@ -177,7 +177,7 @@ public: void memoryBarrier(QMemoryBarrier::Operations barriers); - void setParameters(ShaderParameterPack ¶meterPack); + bool setParameters(ShaderParameterPack ¶meterPack); void readBuffer(GLenum mode); void drawBuffer(GLenum mode); diff --git a/src/render/texture/qabstracttexture.cpp b/src/render/texture/qabstracttexture.cpp index b4d33acf2..76886f438 100644 --- a/src/render/texture/qabstracttexture.cpp +++ b/src/render/texture/qabstracttexture.cpp @@ -120,6 +120,209 @@ void QAbstractTexturePrivate::setDataFunctor(const QTextureGeneratorPtr &generat */ /*! + \enum Qt3DRender::QAbstractTexture::TextureFormat + + This list describes all possible texture formats + + \value NoFormat + GL_NONE + \value Automatic + automatically_determines_format + \value R8_UNorm + GL_R8 + \value RG8_UNorm + GL_RG8 + \value RGB8_UNorm + GL_RGB8 + \value RGBA8_UNorm + GL_RGBA8 + \value R16_UNorm + GL_R16 + \value RG16_UNorm + GL_RG16 + \value RGB16_UNorm + GL_RGB16 + \value RGBA16_UNorm + GL_RGBA16 + \value R8_SNorm + GL_R8_SNORM + \value RG8_SNorm + GL_RG8_SNORM + \value RGB8_SNorm + GL_RGB8_SNORM + \value RGBA8_SNorm + GL_RGBA8_SNORM + \value R16_SNorm + GL_R16_SNORM + \value RG16_SNorm + GL_RG16_SNORM + \value RGB16_SNorm + GL_RGB16_SNORM + \value RGBA16_SNorm + GL_RGBA16_SNORM + \value R8U + GL_R8UI + \value RG8U + GL_RG8UI + \value RGB8U + GL_RGB8UI + \value RGBA8U + GL_RGBA8UI + \value R16U + GL_R16UI + \value RG16U + GL_RG16UI + \value RGB16U + GL_RGB16UI + \value RGBA16U + GL_RGBA16UI + \value R32U + GL_R32UI + \value RG32U + GL_RG32UI + \value RGB32U + GL_RGB32UI + \value RGBA32U + GL_RGBA32UI + \value R8I + GL_R8I + \value RG8I + GL_RG8I + \value RGB8I + GL_RGB8I + \value RGBA8I + GL_RGBA8I + \value R16I + GL_R16I + \value RG16I + GL_RG16I + \value RGB16I + GL_RGB16I + \value RGBA16I + GL_RGBA16I + \value R32I + GL_R32I + \value RG32I + GL_RG32I + \value RGB32I + GL_RGB32I + \value RGBA32I + GL_RGBA32I + \value R16F + GL_R16F + \value RG16F + GL_RG16F + \value RGB16F + GL_RGB16F + \value RGBA16F + GL_RGBA16F + \value R32F + GL_R32F + \value RG32F + GL_RG32F + \value RGB32F + GL_RGB32F + \value RGBA32F + GL_RGBA32F + \value RGB9E5 + GL_RGB9_E5 + \value RG11B10F + GL_R11F_G11F_B10F + \value RG3B2 + GL_R3_G3_B2 + \value R5G6B5 + GL_RGB565 + \value RGB5A1 + GL_RGB5_A1 + \value RGBA4 + GL_RGBA4 + \value RGB10A2 + GL_RGB10_A2UI + \value D16 + GL_DEPTH_COMPONENT16 + \value D24 + GL_DEPTH_COMPONENT24 + \value D24S8 + GL_DEPTH24_STENCIL8 + \value D32 + GL_DEPTH_COMPONENT32 + \value D32F + GL_DEPTH_COMPONENT32F + \value D32FS8X24 + GL_DEPTH32F_STENCIL8 + \value RGB_DXT1 + GL_COMPRESSED_RGB_S3TC_DXT1_EXT + \value RGBA_DXT1 + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + \value RGBA_DXT3 + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + \value RGBA_DXT5 + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + \value R_ATI1N_UNorm + GL_COMPRESSED_RED_RGTC1 + \value R_ATI1N_SNorm + GL_COMPRESSED_SIGNED_RED_RGTC1 + \value RG_ATI2N_UNorm + GL_COMPRESSED_RG_RGTC2 + \value RG_ATI2N_SNorm + GL_COMPRESSED_SIGNED_RG_RGTC2 + \value RGB_BP_UNSIGNED_FLOAT + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB + \value RGB_BP_SIGNED_FLOAT + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB + \value RGB_BP_UNorm + GL_COMPRESSED_RGBA_BPTC_UNORM_ARB + \value R11_EAC_UNorm + GL_COMPRESSED_R11_EAC + \value R11_EAC_SNorm + GL_COMPRESSED_SIGNED_R11_EAC + \value RG11_EAC_UNorm + GL_COMPRESSED_RG11_EAC + \value RG11_EAC_SNorm + GL_COMPRESSED_SIGNED_RG11_EAC + \value RGB8_ETC2 + GL_COMPRESSED_RGB8_ETC2 + \value SRGB8_ETC2 + GL_COMPRESSED_SRGB8_ETC2 + \value RGB8_PunchThrough_Alpha1_ETC2 + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 + \value SRGB8_PunchThrough_Alpha1_ETC2 + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 + \value RGBA8_ETC2_EAC + GL_COMPRESSED_RGBA8_ETC2_EAC + \value SRGB8_Alpha8_ETC2_EAC + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC + \value RGB8_ETC1 + GL_ETC1_RGB8_OES + \value SRGB8 + GL_SRGB8 + \value SRGB8_Alpha8 + GL_SRGB8_ALPHA8 + \value SRGB_DXT1 + GL_COMPRESSED_SRGB_S3TC_DXT1_EXT + \value SRGB_Alpha_DXT1 + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT + \value SRGB_Alpha_DXT3 + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT + \value SRGB_Alpha_DXT5 + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT + \value SRGB_BP_UNorm + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB + \value DepthFormat + GL_DEPTH_COMPONENT + \value AlphaFormat + GL_ALPHA + \value RGBFormat + GL_RGB + \value RGBAFormat + GL_RGBA + \value LuminanceFormat + GL_LUMINANCE + \value LuminanceAlphaFormat + 0x190A +*/ + +/*! * The constructor creates a new QAbstractTexture::QAbstractTexture * instance with the specified \a parent. */ @@ -164,6 +367,9 @@ void QAbstractTexture::setSize(int w, int h, int d) Holds the width of the texture provider. */ +/*! + Set the width of the texture provider to \a width. +*/ void QAbstractTexture::setWidth(int width) { Q_D(QAbstractTexture); @@ -178,6 +384,9 @@ void QAbstractTexture::setWidth(int width) Holds the height of the texture provider. */ +/*! + Set the height to \a height. +*/ void QAbstractTexture::setHeight(int height) { Q_D(QAbstractTexture); @@ -192,6 +401,9 @@ void QAbstractTexture::setHeight(int height) Holds the depth of the texture provider. */ +/*! + Set the depth of the texture to \a depth. +*/ void QAbstractTexture::setDepth(int depth) { Q_D(QAbstractTexture); @@ -237,6 +449,9 @@ int QAbstractTexture::depth() const \note this has a meaning only for texture providers that have 3D or array target formats. */ +/*! + Set the maximum layer count to \a layers. +*/ void QAbstractTexture::setLayers(int layers) { Q_D(QAbstractTexture); @@ -267,6 +482,9 @@ int QAbstractTexture::layers() const \note this has a meaning only for texture providers that have multisample formats. */ +/*! + Set the number of samples per texel to \a samples. +*/ void QAbstractTexture::setSamples(int samples) { Q_D(QAbstractTexture); @@ -293,6 +511,9 @@ int QAbstractTexture::samples() const Holds the format of the texture provider. */ +/*! + Set the texture format to \a format. +*/ void QAbstractTexture::setFormat(TextureFormat format) { Q_D(QAbstractTexture); @@ -303,7 +524,7 @@ void QAbstractTexture::setFormat(TextureFormat format) } /*! - \return the texture provider's format. + Returns the texture provider's format. */ QAbstractTexture::TextureFormat QAbstractTexture::format() const { @@ -316,6 +537,20 @@ QAbstractTexture::TextureFormat QAbstractTexture::format() const Holds the current status of the texture provider. */ + +/*! + \enum Qt3DRender::QAbstractTexture::Status + + Contains the status of the texture provider. + + \value None + \value Loading + \value Ready + \value Error +*/ +/*! + Set the status of the texture provider to the specified \a status. +*/ void QAbstractTexture::setStatus(Status status) { Q_D(QAbstractTexture); @@ -326,7 +561,7 @@ void QAbstractTexture::setStatus(Status status) } /*! - * \return the current status + * \return the current status of the texture provider. */ QAbstractTexture::Status QAbstractTexture::status() const { @@ -341,6 +576,38 @@ QAbstractTexture::Status QAbstractTexture::status() const \note The target format can only be set once. */ +/*! + \enum Qt3DRender::QAbstractTexture::Target + + \value TargetAutomatic + Target will be determined by the Qt3D engine + \value Target1D + GL_TEXTURE_1D + \value Target1DArray + GL_TEXTURE_1D_ARRAY + \value Target2D + GL_TEXTURE_2D + \value Target2DArray + GL_TEXTURE_2D_ARRAY + \value Target3D + GL_TEXTURE_3D + \value TargetCubeMap + GL_TEXTURE_CUBE_MAP + \value TargetCubeMapArray + GL_TEXTURE_CUBE_MAP_ARRAY + \value Target2DMultisample + GL_TEXTURE_2D_MULTISAMPLE + \value Target2DMultisampleArray + GL_TEXTURE_2D_MULTISAMPLE_ARRAY + \value TargetRectangle + GL_TEXTURE_RECTANGLE + \value TargetBuffer + GL_TEXTURE_BUFFER +*/ + +/*! + Returns the target format of the texture provider. +*/ QAbstractTexture::Target QAbstractTexture::target() const { Q_D(const QAbstractTexture); @@ -412,6 +679,10 @@ QVector<QAbstractTextureImage *> QAbstractTexture::textureImages() const Holds whether the texture provider should auto generate mipmaps. */ +/*! + Boolean parameter \a gen sets a flag indicating whether the + texture provider should generate mipmaps or not. +*/ void QAbstractTexture::setGenerateMipMaps(bool gen) { Q_D(QAbstractTexture); @@ -432,6 +703,9 @@ bool QAbstractTexture::generateMipMaps() const Holds the minification filter of the texture provider. */ +/*! + Set the minification filter to the specified value \a f. +*/ void QAbstractTexture::setMinificationFilter(Filter f) { Q_D(QAbstractTexture); @@ -440,12 +714,32 @@ void QAbstractTexture::setMinificationFilter(Filter f) emit minificationFilterChanged(f); } } +/*! + \enum Qt3DRender::QAbstractTexture::Filter + + Holds the filter type of the texture provider. + \value Nearest + GL_NEAREST + \value Linear + GL_LINEAR + \value NearestMipMapNearest + GL_NEAREST_MIPMAP_NEAREST + \value NearestMipMapLinear + GL_NEAREST_MIPMAP_LINEAR + \value LinearMipMapNearest + GL_LINEAR_MIPMAP_NEAREST + \value LinearMipMapLinear + GL_LINEAR_MIPMAP_LINEAR +*/ /*! \property Qt3DRender::QAbstractTexture::magnificationFilter Holds the magnification filter of the texture provider. */ +/*! + Set the magnification filter to \a f. +*/ void QAbstractTexture::setMagnificationFilter(Filter f) { Q_D(QAbstractTexture); @@ -472,6 +766,9 @@ QAbstractTexture::Filter QAbstractTexture::magnificationFilter() const Holds the wrap mode of the texture provider. */ +/*! + Set the wrapmode to the value specified in \a wrapMode. +*/ void QAbstractTexture::setWrapMode(const QTextureWrapMode &wrapMode) { Q_D(QAbstractTexture); @@ -509,6 +806,9 @@ QTextureWrapMode *QAbstractTexture::wrapMode() Holds the maximum anisotropy of the texture provider. */ +/*! + Sets the maximum anisotropy to \a anisotropy. +*/ void QAbstractTexture::setMaximumAnisotropy(float anisotropy) { Q_D(QAbstractTexture); @@ -532,6 +832,9 @@ float QAbstractTexture::maximumAnisotropy() const Holds the comparison function of the texture provider. */ +/*! + Set the comparison function to \a function. +*/ void QAbstractTexture::setComparisonFunction(QAbstractTexture::ComparisonFunction function) { Q_D(QAbstractTexture); @@ -555,6 +858,9 @@ QAbstractTexture::ComparisonFunction QAbstractTexture::comparisonFunction() cons Holds the comparison mode of the texture provider. */ +/*! + Set the comparison mode to \a mode. +*/ void QAbstractTexture::setComparisonMode(QAbstractTexture::ComparisonMode mode) { Q_D(QAbstractTexture); diff --git a/src/render/texture/qpaintedtextureimage.cpp b/src/render/texture/qpaintedtextureimage.cpp index db03b26b9..bc505ee1d 100644 --- a/src/render/texture/qpaintedtextureimage.cpp +++ b/src/render/texture/qpaintedtextureimage.cpp @@ -51,7 +51,7 @@ namespace Qt3DRender { \class Qt3DRender::QPaintedTextureImage \inmodule Qt3DRender \since 5.8 - \brief A QAbstractTextureImage that can be written through a QPainter + \brief A QAbstractTextureImage that can be written through a QPainter. A QPaintedTextureImage provides a way to specify a texture image (and thus an OpenGL texture) through a QPainter. The width and height of the @@ -205,6 +205,11 @@ void QPaintedTextureImage::update(const QRect &rect) d->repaint(); } +/*! + \fn Qt3DRender::QPaintedTextureImage::paint(QPainter *painter) + + Paints the texture image with the specified QPainter object \a painter. +*/ QTextureImageDataGeneratorPtr QPaintedTextureImage::dataGenerator() const { Q_D(const QPaintedTextureImage); diff --git a/src/render/texture/qtexture.cpp b/src/render/texture/qtexture.cpp index 26dfe4d1d..8dde9f9ac 100644 --- a/src/render/texture/qtexture.cpp +++ b/src/render/texture/qtexture.cpp @@ -1079,6 +1079,11 @@ void QTextureLoaderPrivate::updateGenerator() } /*! + \class Qt3DRender::QTextureLoader + \inmodule Qt3DRender + \brief Handles the texture loading and setting the texture's properties. +*/ +/*! * Constructs a new Qt3DRender::QTextureLoader instance with \a parent as parent. * * Note that by default, if not contradicted by the file metadata, the loaded texture @@ -1114,8 +1119,10 @@ QTextureLoader::~QTextureLoader() } /*! - * \return the current texture source. - */ + \property QTextureLoader::source + + Returns the current texture source. +*/ QUrl QTextureLoader::source() const { Q_D(const QTextureLoader); diff --git a/src/render/texture/qtexturegenerator.cpp b/src/render/texture/qtexturegenerator.cpp index 32b785128..5e350af2d 100644 --- a/src/render/texture/qtexturegenerator.cpp +++ b/src/render/texture/qtexturegenerator.cpp @@ -43,6 +43,10 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! class Qt3DRender::QTextureGenerator + \inmodule Qt3DRender + \brief Generates the necessary information to create an OpenGL texture image. +*/ QTextureGenerator::~QTextureGenerator() { } @@ -53,6 +57,16 @@ QTextureGenerator::~QTextureGenerator() \inmodule Qt3DRender \brief Provides the image data for a texture. */ +/*! + \fn QTextureDataPtr Qt3DRender::QTextureGenerator::operator()() + + Returns the texture data. +*/ +/*! + \fn bool Qt3DRender::QTextureGenerator::operator==(const QTextureGenerator &other) const = 0 + + Compare these texture data to \a other. Returns \c true if both are equal. +*/ } // Qt3DRender QT_END_NAMESPACE diff --git a/src/render/texture/qtexturewrapmode.cpp b/src/render/texture/qtexturewrapmode.cpp index ee831f409..cb9272895 100644 --- a/src/render/texture/qtexturewrapmode.cpp +++ b/src/render/texture/qtexturewrapmode.cpp @@ -108,6 +108,8 @@ void QTextureWrapMode::setX(WrapMode x) } /*! + \property QTextureWrapMode::x + Returns the wrap mode of the x dimension. */ QTextureWrapMode::WrapMode QTextureWrapMode::x() const @@ -117,6 +119,19 @@ QTextureWrapMode::WrapMode QTextureWrapMode::x() const } /*! + \enum Qt3DRender::QTextureWrapMode::WrapMode + + Specifies the type of text wrapping. + Possible values: + + \value Repeat + \value MirroredRepeat + \value ClampToEdge + \value ClampToBorder +*/ + + +/*! Sets the wrap mode of the y dimension to \a y. \note this is not available on 1D textures. */ @@ -130,6 +145,8 @@ void QTextureWrapMode::setY(WrapMode y) } /*! + \property QTextureWrapMode::y + Returns the wrap mode of the y dimension. */ QTextureWrapMode::WrapMode QTextureWrapMode::y() const @@ -152,6 +169,8 @@ void QTextureWrapMode::setZ(WrapMode z) } /*! + \property QTextureWrapMode::z + Returns the wrap mode of the z dimension. */ QTextureWrapMode::WrapMode QTextureWrapMode::z() const diff --git a/tests/auto/render/filtercompatibletechniquejob/BLACKLIST b/tests/auto/render/filtercompatibletechniquejob/BLACKLIST new file mode 100644 index 000000000..c9313fd62 --- /dev/null +++ b/tests/auto/render/filtercompatibletechniquejob/BLACKLIST @@ -0,0 +1,4 @@ +[checkRunRendererNotRunning] +windows +[checkRunRendererRunning] +windows diff --git a/tests/auto/render/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp b/tests/auto/render/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp index c26394c69..83e816861 100644 --- a/tests/auto/render/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp +++ b/tests/auto/render/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp @@ -85,7 +85,8 @@ public: Qt3DRender::Render::NodeManagers *nodeManagers() const { - return d_func()->m_renderer->nodeManagers(); + return d_func()->m_renderer + ? d_func()->m_renderer->nodeManagers() : nullptr; } void initializeRenderer() @@ -198,7 +199,11 @@ private Q_SLOTS: Qt3DRender::TestAspect testAspect(buildTestScene()); // WHEN - backendFilterCompatibleTechniqueJob.setManager(testAspect.nodeManagers()->techniqueManager()); + Qt3DRender::Render::NodeManagers *nodeManagers = testAspect.nodeManagers(); + QVERIFY(nodeManagers); + Qt3DRender::Render::TechniqueManager *techniqueManager = nodeManagers->techniqueManager(); + QVERIFY(techniqueManager); + backendFilterCompatibleTechniqueJob.setManager(techniqueManager); backendFilterCompatibleTechniqueJob.setRenderer(testAspect.renderer()); testAspect.initializeRenderer(); testAspect.renderer()->shutdown(); @@ -223,7 +228,11 @@ private Q_SLOTS: Qt3DRender::TestAspect testAspect(buildTestScene()); // WHEN - backendFilterCompatibleTechniqueJob.setManager(testAspect.nodeManagers()->techniqueManager()); + Qt3DRender::Render::NodeManagers *nodeManagers = testAspect.nodeManagers(); + QVERIFY(nodeManagers); + Qt3DRender::Render::TechniqueManager *techniqueManager = nodeManagers->techniqueManager(); + QVERIFY(techniqueManager); + backendFilterCompatibleTechniqueJob.setManager(techniqueManager); backendFilterCompatibleTechniqueJob.setRenderer(testAspect.renderer()); testAspect.initializeRenderer(); |