summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding QDoc to QStencilOperationRobert Brock2016-05-261-0/+18
| | | | | | | | | Adding documentation to aid in the explanation of how to use QStencilOperation and its general relation to OpenGL Change-Id: I5ba0c256f24871f3b6e76c9d3915e33c46154930 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QStencilMaskRobert Brock2016-05-261-2/+25
| | | | | | | | | Adding documentation to aid in the explanation of how to use QStencilMask and its general relation to OpenGL Change-Id: If5779783c0a57782c79f6ea86fbfbb9b30555768 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QScissorTestRobert Brock2016-05-261-0/+41
| | | | | | | | | Adding documentation to aid in the explanation of how to use QScissorTest and its general relation to OpenGL Change-Id: I6a48299b14ad100f3dcb4bc4edd28a8af5d65be9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QPolygonOffsetRobert Brock2016-05-261-0/+27
| | | | | | | | | Adding documentation to aid in the explanation of how to use QPolygonOffset and its general relation to OpenGL Change-Id: I7898993bd70afed05eae9b29c69c5b2fe368d2f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QFrontFaceRobert Brock2016-05-261-0/+18
| | | | | | | | | Adding documentation to aid in the explanation of how to use QFrontFace and its general relation to OpenGL Change-Id: I19df2540e9d536950b664574a79423a6f4dbf5c1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QDepthTestRobert Brock2016-05-261-0/+18
| | | | | | | | | Adding documentation to aid in the explanation of how to use QDepthTest and its general relation to OpenGL Change-Id: I8033ac2c0b62a7706c4bdd55603f5f99bbe29bda Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QCullFaceRobert Brock2016-05-261-0/+22
| | | | | | | | | Adding documentation to aid in the explanation of how to use QCullFace and its general relation to OpenGL. Change-Id: I44fc7d02c0fbc81a9089a0463784ccb5f461591b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QBlendEquationRobert Brock2016-05-261-0/+19
| | | | | | | | | Adding documentation to aid in the explanation of how to use QBlendEquation and its general relation to OpenGL. Change-Id: Ie4645bb313b23bfd1daed914078f24a75fe1efe3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adding QDoc to QAlphaTestRobert Brock2016-05-261-0/+24
| | | | | | | | | Adding documentation to aid in the explanation of how to use QAlphaTest and its general relation to OpenGL. Change-Id: I00c0265f07b063d8bb57ad1c90337940b1425677 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add doc skeleton for Qt3DInputTomi Korpipää2016-05-2520-133/+509
| | | | | | | | | | | | | Conflicts: src/input/frontend/qanalogaxisinput.cpp src/input/frontend/qaxis.cpp src/input/frontend/qaxissetting.cpp src/input/frontend/qbuttonaxisinput.cpp src/input/frontend/qinputsettings.cpp src/input/frontend/qmousedevice.cpp Change-Id: Ic3e06179f745520d9c49af8d8242af360cbd20d8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Start of Skeletal Doc for render-materialsystemColin Ogilvie2016-05-255-19/+159
| | | | | | Task-number: QTBUG-46037 Change-Id: I8f2a2ed2068cbe7a4a9265a56c99845a0322df2c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNode: fix missing check for nullptrPaul Lemire2016-05-251-1/+2
| | | | | Change-Id: I192c5a44839d5dfdc3d0ccf139c4f4c865f94f10 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Initialize dynamic properties of lightsSean Harmer2016-05-252-2/+4
| | | | | | | | | | | | Forces them to be initialized so they exist when the property reader is used for later updates. Also use correct type in default value setting of uniforms. Task-number: QTBUG-53585 Change-Id: Id594670ea75385c1d54f06d4d7c6241d77403ce6 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Default constant of attenuation to 1.0Sean Harmer2016-05-252-2/+2
| | | | | | | | | | | Without this, the default was 0 for the constant attenuation factor. This is bad because if the user only sets the linear and/or quadratic constants, then when the distance gets small, the denominator in the lighting equation gets very large causing a lot of saturation of the renderered meshes. Change-Id: Ie1b8b2d24702090879cb1429912eb51aeb002f68 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Entity: use NodeAdded to update the childrenHandlesPaul Lemire2016-05-251-0/+18
| | | | | Change-Id: I85d78d99c18544944ffae11eaf76e89a54d5e828 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Node bookkeeping fix: clear table of connection in QNode dtorPaul Lemire2016-05-251-6/+8
| | | | | | | | | Clearing it in the QNodePrivate dtor is actually too late, this needs to happen before QNode::destroyed is emitted. Task-number: QTBUG-53456 Change-Id: I4141b51c3576a348fa4c82a2a4e7806d8b545ab0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove deleted entries from RenderStateCollection cacheJanne Koskinen2016-05-253-4/+14
| | | | | | | | | | When deleting materials RenderPass contains node id's of materials in cache index pointing to destroyed RenderStates. Change removes ids for deleted entries when collection is dirty Task-number: QTBUG-53308 Change-Id: Ibc61c3add1f6d88603310bc46f434fb5b27db11a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Change default RenderPolicy to AlwaysMiikka Heikkinen2016-05-241-1/+1
| | | | | | | OnDemand policy doesn't work reliably in all cases yet. Change-Id: Id70e17a30f6600be988c28eedcd974eb1dcd3b3d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Skeletal Doc for QSceneLoaderColin Ogilvie2016-05-241-1/+41
| | | | | | | Task-number: QTBUG-46037 Change-Id: I1e20f5de688b5179382836a17b7a21caa869e8a6 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Start on skeleton doc for render-framegraphColin Ogilvie2016-05-247-6/+182
| | | | | | | Task-number: QTBUG-46037 Change-Id: Ided34e5a0aed66bd67e8aef7af6689a31a09dc29 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* doc for qtextureimagedataColin Ogilvie2016-05-241-0/+59
| | | | | | | Task-number: QTBUG-46037 Change-Id: I5dd5616cd6ef3a01326cbc312a5d1809e60b74d2 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* TextureMaterial.qml change remaining annotations to filterKeys.Unai IRIGOYEN2016-05-231-3/+3
| | | | | Change-Id: I265a1820ee8f02abe7f8c67c269a4842e583469d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid changing access rights to virtual methodsMike Krus2016-05-232-6/+11
| | | | | | | | Added QRenderAspectTester as friend for testing Task-number: QTBUG-53569 Change-Id: Ia7adde188065a2ba02b7fd480fcfe545ccbf4720 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit tests for QKeyboardHandlerKevin Ottens2016-05-234-5/+8
| | | | | | | | | Also repairs the sourceDevice notification change since the tests showed up it was broken. Change-Id: I20b81806452e54f89353f35464b5241de6e18a99 Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* initializeFromPeer last when creating backend nodeKevin Ottens2016-05-231-1/+3
| | | | | | | | | This fixes issue with the focus handling in KeyHandler since initializeFromPeer checks the enabled state to request focus or not. Change-Id: Ib33f6a7fcec3cb96c1a71b3e6ba0be5f8eb942ed Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add hook to set QNode parent when creating a QNode in QMLSean Harmer2016-05-232-2/+43
| | | | | | | | | | Just need to be a little careful in QNode::setParent() and the helper in case the qml engine sets a QObject parent but QNode doesn't know about it yet. Task-number: QTBUG-47055 Change-Id: I30269bd230ee6eacd2816282fd48f879cfb7c83a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Shared node bookkeepingPaul Lemire2016-05-2329-14/+269
| | | | | | | | | | | | Any time a property references a QNode there is a risk that the node gets destroyed and then the property is left pointing to a dangling pointer. To handle such cases, setters of such properties are able to use a helper that internally connect QObject::destroyed signal to a setter removal method. Change-Id: I42428c851d0e3d2d88ab0cf6a5b75605334ec648 Task-number: QTBUG-53456 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Replace Q_DECL_NOEXCEPT by Q_DECL_NOTHROWPaul Lemire2016-05-2330-120/+120
| | | | | | Change-Id: Ia991da557483704055e0ccf17b4a6b273568a1ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Repair AxisSetting handling in physical devicesKevin Ottens2016-05-232-19/+36
| | | | | | Change-Id: I9989f5ccf7871eb60083c4fcb40d4eb9158b1b19 Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make sure the axisSettings is found by QtCreatorKevin Ottens2016-05-231-28/+4
| | | | | Change-Id: Ic9d8cd875afa80bd2761df4205b521f3d4aa59c3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QVector instead of QVariantList propertiesKevin Ottens2016-05-235-27/+13
| | | | | Change-Id: I183bac3fb423d068df4f65ae96a7706f83cfa20f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QVector instead of QVariantList propertiesKevin Ottens2016-05-235-60/+70
| | | | | Change-Id: If7b2688c6032132cfabe5ff02ecbbcf3efbb29d0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Respect the QRenderSettings::RenderPolicySean Harmer2016-05-231-3/+0
| | | | | | | | | | | | Works in most cases. In some situations like a shader using time as an input the user should use the Always renderpolicy. We can make the backend support more such cases in the future. Task-number: QTBUG-48329 Change-Id: Ib34f7cfb517a9c4d2789d7b49a0de62831dd4746 Reviewed-by: Janne Koskinen <janne.p.koskinen@theqtcompany.com> Reviewed-by: Volker Krause <volker.krause@kdab.com>
* Fix dynamic shader code updatesSean Harmer2016-05-222-6/+9
| | | | | | | | | Being careful to remove cached pointer to the shader program from the graphics context. Task-number: QTBUG-53527 Change-Id: Icee8aaa3f0900c7aa42598ad81b3f368f0338f46 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove unused ctor from QPropertyNodeRemovedChangeSean Harmer2016-05-212-6/+0
| | | | | Change-Id: I5aacd50cc13172f89428783ea23fdaf494712c7d Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Only try to create render jobs if we have a settings objectSean Harmer2016-05-201-2/+5
| | | | | | | Task-number: QTBUG-42353 Task-number: QTBUG-51035 Change-Id: Ic6ebaace64d314d23d85c38ed93029498167832f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Allow the QtQuick + Scene3D case to shutdown cleanlySean Harmer2016-05-204-3/+29
| | | | | | | | | | | | | | | | | | | | | | | ...by having the Scene3D item exit the simulation loop before asking the renderer to shutdown. This is necessary because if we let the simulation loop keep running then the render aspect keeps creating and executing jobs as we pull the rug out form under it by shutting down the renderer. This exhibited quite regularly as a crash caused by a race in the Shader::cleanup() function which tried to access the GraphicsContext that was destroyed by the renderer shutdown. This approach sequences things very similarly to the pure Qt 3D shutdown method. The main difference is that we explicitly stop the simulation loop whereas in the pure Qt 3D case, that is done for us by the QAspectEngine::setRootEntity(null) call. This is still done in the QAspectEngine dtor but by that time, the simulation loop is already stopped. The exit simulation logic has been adapted to handle this case. Task-number: QTBUG-51035 Task-number: QTBUG-42353 Change-Id: I08d16e301eab421fa6eb99e558f38e832534c151 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Pass the static meta object to the creation changesSean Harmer2016-05-201-1/+44
| | | | | | | | | | | | | | | | Unfortunately we can't rely upon QObject::metaObject() because the dynamic metaobjects created by QML may well get destroyed before the Qt 3D backend has had time to use the metaobjects to lookup the node mappers for deleting the backend nodes. QMetaObject at this time has no way of determining if it is a static or dynamic metaobject so we have to take the same approach as GammaRay and walk up the QMetaObject::superData() chain to find the most "derived" metaobject without a dynamic metaobject above it. Task-number: QTBUG-42353 Change-Id: Ifb8512c75241a7a2d8035dd7384a589e1b9844d9 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Improvements to RenderSettingsSean Harmer2016-05-202-11/+7
| | | | | | | | | | | | Get function now returns the RenderSettings object so that it can be destroyed in response to a node destroyed change. No need for a cleanup function as it's not managed by a resource manager that needs to recycle it. Instead initialize in the ctor initializer. Change-Id: I0ac6c43d1ce99bf7e1532580901894c8457c1a56 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Allow the backend chance to process any final changes during shutdownSean Harmer2016-05-205-5/+28
| | | | | | | | | | | | | | | | | | | | | The QAspectEngine now flushes any pending changes batched up before telling the aspect manager to exit the simulation loop. Furthermore, the call to QAspectManager::exitSimulationLoop() now waits until the aspect thread has completely finished the simulation loop and has called onEngineShutdown() on each of the aspects. This is important to ensure that the main thread doesn't call QAspectEngine::shutdown() too early as this deletes the change queue which contains the final changes sent from the main thread during shutdown. For some reason the backend is unable to find which QBackendNodeMapper corresponds to each destruction change. Will investigate that next. Task-number: QTBUG-42353 Change-Id: Iec4d6a57a163effefd5b60249bf97c76ed187413 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Avoid crash in QML app shutdown and actually send events in C++ appSean Harmer2016-05-202-16/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic was such that in a C++ application the QNode::setParent() function would bail out early in a C++ application when called from the destructor of its parent object. This is because by the time the child is being deleted the parent is in QObjectPrivate::deleteChildren and therefore the QNode part of the object has already been destroyed. This led to the cast in the parentNode() == parent to fail, thereby exiting the functio early and never getting into QNodePrivate::_q_setParentHelper(). In the case of a QML application, the parent has a dynamic metaobject set by the QML engine. This resulted in the cast in QNode::setParent() succeeding and we called into _q_setParentHelper(). The logic in here resulted in a crash when called from a destructor because the child had already been removed from its parent's list of children. Thus when we called QObjectPrivate::setParentHelper(), this function ended up with an index of -1 for the child in its child list (i.e. not found) and it then tried to index into the children list with this index and we then crashed. The solution in this change is to not do the full logic in QNode::setParent() and _q_setParentHelper(). Rather, we simply remove the subtree at this node from the scene and we send node destruction changes to the backend. With this we avoid the crash of QML application shutdowns and we also make sure to correctly send the node destruction changes even in the case of a C++ Qt 3D application. The backend does not yet get an opportunity to process these final changes. This will be addressed in a follow up commit. As a result of these changes many unit tests began crashing. This is because the QNode dtor is now actually doing some work, rather than bailing out of that work early when the parent is no longer a QNode. This work involves mutating the QScene object which in the unit tests did not live longer than the QNode's to which it was associated with. The unit tests have been adjusted to ensure that the arbiter and scene objects remain alive longer than the QNodes they are being used to test. Task-number: QTBUG-42353 Change-Id: I197870f48fca30656bd85c4c51346d93403fba08 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Remove qDebug()Sean Harmer2016-05-201-1/+0
| | | | | Change-Id: I02abc0462963fd32d3742e77a4915c9344b3051a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Add "We mean it warning"Sean Harmer2016-05-201-0/+11
| | | | | Change-Id: I12638f4cc71d6f7dab405228ce88a1a6e52c6569 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QTexture: cleanupPaul Lemire2016-05-209-670/+756
| | | | | | | | | Load compressed files in QFromSourceTextureGenerator and remove related code from QTextureImageData. Unify loading code paths for texture generator and image. Change-Id: Iebeb67bf1e542f55af06880b1d725c2de70b8ccb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make QTexture use QTextureSourceGeneratorPaul Lemire2016-05-209-51/+144
| | | | | | | Instead of using a QTextureImageDataGenerator which was confusing Change-Id: Ibbda6b2e8ddf6a917e1d1c0b1e086596c8c30510 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add a QTextureSourceGeneratorPaul Lemire2016-05-202-0/+69
| | | | | | | This will take care of generating a texture from a source file Change-Id: I11a9b1686d07aceea2211981576d00819020af90 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add qtexture_p.hPaul Lemire2016-05-203-11/+78
| | | | | Change-Id: I72c95a9e50646d822ec1508acedf775082a19c9d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QTextureGeneratorPaul Lemire2016-05-203-3/+128
| | | | | | | | Right now QTexture can provide a QTextureImageDataGenerator which doesn't make sense. This will act as a proper replacement. Change-Id: I32f412d901018d2f4f49a060cd93cd21c28941b9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Added QTextureDataPaul Lemire2016-05-203-2/+397
| | | | | | | | | QTextureGenerator will have to return this object which will allow to asynchronously create the whole texture and provide all the necessary information the backend expects. Change-Id: I71bdf85ac8e3aa3befd187c5f3d768045dd15ea2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture: proper code alignmentPaul Lemire2016-05-202-23/+23
| | | | | Change-Id: I28f12dbc9418fc8a5d0254a43c02a66dd420e459 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>