summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* RenderStates: rework to split node and rendering partPaul Lemire2018-03-1911-527/+591
| | | | | | | | | | The apply method was removed from GenericState and its subclasses. This allows to keep the GenericStates in the aspect part and let the renderer perform the right calls based on the state class it is provided with. Change-Id: I9c3ac04b4eb489e7443e67615e35e850c0aba07f Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderThread: use AbstractRenderer* instead of Renderer*Paul Lemire2018-03-194-9/+8
| | | | | | | | | So that we can reuse the RenderThread class with different types of renderers. Change-Id: I797b599d64f5c846b8e2ae95eba2394033a1e4b0 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Move Renderer specific classes into new folderPaul Lemire2018-03-1979-188/+128
| | | | | | | | This is another step toward isolating the renderer from the render aspect Change-Id: I4031675b961d6645b65bbe05cf62d150993038b0 Task-number: QTBUG-61151 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* configure: Auto-detect that AVX2 is enabledOswald Buddenhagen2018-03-181-1/+1
| | | | | | | | | | | If the user has an mkspec that turns AVX2 on (i.e., -march=haswell or similar option added to QMAKE_CXXFLAGS), the compiler will be using AVX2 for normal code generation. In this case, we should enable our AVX2-optimized code as well. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I940917d6763842499b18fffd15134b004028c6ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Render: Add configure option for the OpenGL rendererPaul Lemire2018-03-163-0/+33
| | | | | | | | | This is the first step in making the QRenderAspect more modular and not dependent on a single renderer forever. Change-Id: I27cecdcfda382859343f1b51fbe730bb998258fb Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Perform Shader loading within framePaul Lemire2018-03-1611-63/+307
| | | | | | | | | | | | | | | - CommandThread has been improved to not use an exec loop and properly instantiate its own GL context + GraphicsContext that is bound to an offscreen surface - The dirtyShaderGathering job has been renamed and now performs the loading of shaders and their introspection. It is also run before the materiaparameter gathering, so that these jobs and the following can assume a shader is ready Change-Id: I6d99b3a104bd96530dc45f4b05d3aaac09d2d077 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Split GraphicsContext in twoPaul Lemire2018-03-1617-1379/+1631
| | | | | | | | | - GraphicsContext is now a stateless wrapper around GL calls - SubmissionContext is a GraphicsContext + caches and states used to render a frame Change-Id: I147b56dfd4c403911faadc0e9821fff9a892f71c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Renderer: instantiate, initialize and shutdown CommandThreadPaul Lemire2018-03-164-0/+28
| | | | | | | Change-Id: I89a3ee4b6d72565c1be91244c1bde39f1dd7101b Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Notify node dirty on texture downloadMike Krus2018-03-161-2/+2
| | | | | Change-Id: Ia04f278ef474d39aaa7c2ba516c83ed6227e660d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Notify texture status changedMike Krus2018-03-162-2/+9
| | | | | Change-Id: Id8ef731d5f80648c19221c1d1b334bd8367188c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Document state of the Qt 3D modulesKai Koehne2018-03-129-12/+44
| | | | | | | | | | | | | Do make it explicit which ones are still in development also in the landing page, and add \preliminary and \since tags (for released and TP modules, respectively). Note that the \preliminary, \since tags currently do not work for \qmlmodule, which hopefully gets fixed at one point: QTBUG-65963. Change-Id: I6648311c38f331286be37eefa60794984cd239b7 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix compile warningMike Krus2018-03-101-4/+4
| | | | | | | signed/unsigned comparison Change-Id: Ic5bb10313cdc1c108df68017146dbab876b4d706 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* visitorutils_p.h: add proper header guardv5.11.0-beta2Paul Lemire2018-03-091-3/+3
| | | | | Change-Id: If994bef73fc10348bb0364f11a267856428907a5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Enable alpha blending on QTextureMaterialMike Krus2018-03-084-0/+63
| | | | | Change-Id: I8466ccd47f8bda9fec184f548a2df7807d456ac7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Don't assume position attribute uses default name in visitPrimitivesAndy Nichols2018-03-081-1/+3
| | | | | | | | | | | | | | | | | It is not ok to assume that the position attribute has the default position attribute. It should be the fallback behavior like it is in calculateLocalBoundingVolume. In this case we should try and query the boundingPositionAttribute if it is set. If anything this could have been called just "positionAttribute" since we need to introspect mesh data in a few places and need to know the positionAttribute. The previous logic meant that meshes used by Qt 3D Studio could not take advantage of advanced picking (anything other than bounding spheres) because it does not use the built-in materials or default attribute names (they are optional after all). Change-Id: I5b02a0532add1582ae48121cdc6a7b3040ad1cdd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Documentation for ray castingMike Krus2018-03-077-32/+389
| | | | | | | | Also updated object picker and pick settings and made raycaster components non-sharable. Change-Id: Ief3e5dcb3eefdd94c05e7a4e914b43d56b43e24a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add more job tests for raycastingMike Krus2018-03-079-48/+511
| | | | | | | | | | - test screen space ray casting - fixed handling of filters - fixed handling of ray length - few tests for filter handling Change-Id: Ifc24d8f9e73556669338b3936a41dfa2c674e306 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Either fully qualify property types, or not at allVolker Krause2018-03-063-4/+4
| | | | | | | | | The semi-qualified types confuse the meta type system, QAbstractAnimation in particular, as that also exists as a top-level type. Change-Id: If20387fe76d46f88f6a89523d5d3f4aac8b1fef0 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* ObjGeometryLoader::doLoad(): Fix fall through warningsFriedemann Kleint2018-03-021-0/+2
| | | | | | | | | | | Fix: objgeometryloader.cpp:161:49: warning: this statement may fall through [-Wimplicit-fallthrough=] objgeometryloader.cpp:163:51: warning: this statement may fall through [-Wimplicit-fallthrough=] Amends 4338a85487788bb553cef0eaa5e5a3f929934eea. Change-Id: I4a77a6436eef0d91ccc69decdfe4365dfdc5df22 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add unit test to check memory alignmentPaul Lemire2018-03-015-0/+267
| | | | | Change-Id: I59b817f9972d0a6866f7cc57a4bcd6fe2cd097c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add test to check if readding shader removes dna from m_pendingRemovalAnders Hafreager2018-02-281-0/+27
| | | | | | | Task-number: QTBUG-66498 Change-Id: Icb18a996c9384b3e41f296694d91b13677f054c4 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Prevent readded shaders to be purged from cacheAnders Hafreager2018-02-281-0/+2
| | | | | | | | | | | | | In ShaderCache::removeRef, the shader DNA is added to m_pendingRemoval. Previously, if the shader was readded before ShaderCache::purge was called, ShaderCache::purge would still remove it even if it was in use. This change removes a readded shader DNA from m_pendingRemoval. Task-number: QTBUG-66498 Change-Id: If18b28273cccfd2a8cba2c7bc6379d983ce6ecb9 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Fix documentation warnings for Qt 3D RenderTopi Reinio2018-02-2818-68/+57
| | | | | | | | | | | | | This change fixes multiple QDoc warnings for Qt 3D Render that are related to how Clang parses the source code and the \fn QDoc commands. A number of changes are related to preventing documentation for private classes from generating warnings. We still have a number of 'No documentation for ...' warnings left - those are not addressed in this change. Change-Id: Ic92a729496a81e7869060811ed7dd23408cff833 Reviewed-by: Martin Smith <martin.smith@qt.io>
* QResourcesManager: remove simd code from headerPaul Lemire2018-02-283-18/+57
| | | | | | | | Rather move the simd code to a .cpp file that gets compiled once with the proper flags Change-Id: Ifc28eed844ef94224f45d0e307046a1cb884bf14 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix SIMD related warningsPaul Lemire2018-02-281-2/+4
| | | | | Change-Id: Ia7d08551de0b10e3e859da5301ea8e2be501c722 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* simd: declare AVX2 friends only if __AVX2__ definedPaul Lemire2018-02-283-13/+20
| | | | | Change-Id: I8fd88461874367bcaa9f4b27a9b4fc660cd2a030 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RenderThread: fix races with texture and bufferPaul Lemire2018-02-283-2/+15
| | | | | | | | Add dependencies to ensure we won't allow the RenderThread to proceed if we haven't completed the execution of the texture and buffer gatherer jobs. Change-Id: Iaad67be893738b948bf26ca903f3bff7f16a1b88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix race between RenderThread and ShaderGathererJobPaul Lemire2018-02-283-3/+6
| | | | | | | | | | By setting the proper dependency which ensures we are done looking for dirtyShaders by the time updateGLResources in the RenderThread is executed. Patch provided by svenn-arne.dragly@qt.io Change-Id: I4515cbfc3a391f887a42178220e6f0814a707745 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix RenderView uniform minificationPaul Lemire2018-02-283-7/+89
| | | | | | | | | In the case where we had two or more groups of RenderCommands where each group shares a common shader, uniform minification wouldn't be applied to the second command of each groups after the first one. Change-Id: Ie73f559e3f44f0f22ddd79017fd413262cae6ab4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Load textures in a single framePaul Lemire2018-02-2811-112/+372
| | | | | | | | | | | | | | | | | Because of texture sharing, Qt3D compares functor before executing them. Instead of blindly loading a TextureImage functor which could turn out to not be used, Qt3D required 2 frames to fully update a texture. This behavior has been removed, now when a texture image functor is updated, it updates the texture in one frame. It is assumed that the user is responsible for declaring only TextureImage that he is actually going to use. Any scene that uses OnDemand rendering and frequently changes a texture image functor can be used to test this. (ex-painted-cube is a good example for KDAB) or paintedtexture-cpp in manual tests Change-Id: I8c2f13876244a862633e10e472e2b49cbd6e126b Task-number: QTBUG-63561 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Revert "Keep rendering in sync with aspect jobs by adding barriers"Paul Lemire2018-02-2828-911/+437
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 46319648436814afb5a77755dde6681e304befaf. We want to be able to render one set of RenderViews for frame n while concurrently building RenderViews for frame n + 1. The reverted commit removed that behavior which reduced the CPU time available to prepare a frame. This would cause on some scenes a failure to meet the ~10ms budget we have to prepare a frame. This is therefore a regression. The root cause behind this regression is that a job cannot be executed until all the jobs which have been previously launched have completed. The proposed solution would be to instead add an OpenGL command thread that can be used to load graphics resources required for the RenderViews directly when required. This would in turn allow to cache RenderViews and keep the concurrent behavior of RenderView submission and creation. With that goal in mind, the following patches will be rebased and updated https://codereview.qt-project.org/#/c/189309/ https://codereview.qt-project.org/#/c/189310/ Change-Id: I4879047c45986a0e615e3aef7b7352f82a04a9da Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Set mip levels correctly when having only texture imagesLaszlo Agocs2018-02-271-0/+9
| | | | | | | | | | Otherwise it is impossible to provide custom texture data for multiple mip levels. (as QTextureImageData is the only public API; there is no texture data generator in this case, only individual texture images) Task-number: QTBUG-66686 Change-Id: Iaab37ee6510ffd4db07ce7865d9b6f0ff80d2947 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add unit test for QScreenRayCasterv5.11.0-beta1Mike Krus2018-02-243-0/+142
| | | | | Change-Id: I76933b23f27bc0fefcbc55342715b2ebd7f7716d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add unit test for layers on raycasterMike Krus2018-02-231-0/+84
| | | | | Change-Id: I5f8401e7a61924fbfe88fddf5b44fd77fa92099d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add debug support for SphereMike Krus2018-02-232-0/+17
| | | | | Change-Id: I8262ada29898df37c33855b9cb33aead419b02a6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update QRay3D stream IOMike Krus2018-02-231-2/+7
| | | | | | | for debugging and streaming Change-Id: Id9924fa9a99c6412069e6907473d0dfe083e3107 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add a warning to texture loading mirrored propertyAdam Treat2018-02-222-4/+24
| | | | | | | | | | | | The default behavior for texture loading of uncompressed or CPU compressed images results in a performance price at runtime. Add a warning to the documentation describing this behavior and how to avoid it. Ideally, in the future we'll have an asset conditioning pipeline that will handle this in an optimal manner for the user of the 3D framework. Change-Id: I795d011adfedcbcf8d80224a36adbf9465140066 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix color scaling in copyGLFramebufferDataToImageAnders Hafreager2018-02-221-3/+3
| | | | | | | | | | | | | | | | | Previous implementation used a component conversion for QAbstractTexture::RGBA32F (when GL_TYPE is GL_FLOAT) which results in a non-linear mapping from [0,1] to [0,127]. A non-linear mapping should only be used for some GL_TYPE other than GL_FLOAT. See https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/ glReadPixels.xhtml for more. This change maps color linearly to the range [0,255] when QAbstractTexture::TextureFormat is QAbstractTexture::RGBA32F. Task-number: QTBUG-66514 Change-Id: I4aa36b59acd193c7342ba4b0577f132e0c19ef85 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-219-10/+140
|\ | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp tests/auto/auto.pro Change-Id: Idc5bb088ae7f591809f8795124a3e44410bf4cf9
| * Fix OnDemand rendering by keeping ComputeDirty from being re-enabledSvenn-Arne Dragly2018-02-142-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation would reset ComputeDirty every frame if markDirty(AllDirty) had been called earlier. This would break the OnDemand rendering policy because every frame would be rendered even if there were no changes or no compute commands in the scene. This change removes the code that would re-enable the ComputeDirty flag every frame and documents that the user must either set the rendering policy to Always or trigger the rendering of a new frame if the rendering policy is set to OnDemand. Change-Id: Ide03a3a49ee1670fd9d67ed47454c6679219765d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Remove null pointer checkJesus Fernandez2018-02-121-2/+2
| | | | | | | | | | | | | | | | >>> CID 187918: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "node" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Change-Id: Ic799724e91d118a2c5b2715c5742a4184b09a217 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * ObjGeometryLoader: Fix out of bound errorPaul Lemire2018-02-087-8/+124
| | | | | | | | | | | | | | Apparently this was a major security issue reported to security.qt-project.org Change-Id: Id52f035134ca6111e24b5820eb1b64b99449e47f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QParameter: add bookkeeping of QNode valuesPaul Lemire2018-02-213-4/+48
| | | | | | | | | | Change-Id: I0a7334907e4b34df6955fb24832958b674d7b62b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Revert "CameraControllers: use the Camera's upVector"Sean Harmer2018-02-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 627167bd4a2e1dc12ffee813e82f9b33bff19a22. There was a reason to use the y axis as the up vector here which is to keep the camera controller oriented correctly. Without this restriction it's far too easy to end up with a twisted camera. If we want a fully free trackball type controller, let's add that as a new type, or perhaps as an option on these. Change-Id: I56c8708535d4ccd05ccb5f2ddea732bb27abda58 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Doc: Fix documentation warnings for Qt 3D CoreTopi Reinio2018-02-1616-53/+47
| | | | | | | | | | | | | | | | | | | | | | | | This change fixes multiple QDoc warnings for Qt 3D Core that are related to how Clang parses the source code and the \fn QDoc commands. We still have a number of 'No documentation for ...' warnings left - those are not addressed in this change. Change-Id: Ia6394f453d7bd959bc4d4cc9347ac0039b80f661 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.10' into 5.11" into ↵Sean Harmer2018-02-15135-1471/+3023
|\ \ | | | | | | | | | refs/staging/5.11
| * \ Merge remote-tracking branch 'origin/5.10' into 5.11Sean Harmer2018-02-15135-1471/+3023
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/animation/doc/src/qt3danimation-module.qdoc src/render/backend/abstractrenderer_p.h src/render/backend/buffervisitor_p.h src/render/backend/renderer.cpp src/render/backend/renderer_p.h src/render/backend/triangleboundingvolume_p.h src/render/backend/trianglesextractor_p.h src/render/frontend/sphere_p.h src/render/jobs/calcboundingvolumejob.cpp src/render/jobs/job_common_p.h src/render/jobs/pickboundingvolumejob.cpp src/render/jobs/pickboundingvolumejob_p.h src/render/jobs/pickboundingvolumeutils.cpp src/render/jobs/renderviewjobutils_p.h tests/auto/render/boundingsphere/tst_boundingsphere.cpp tests/auto/render/commons/testrenderer.h tests/auto/render/raycasting/tst_raycasting.cpp tests/auto/render/render.pro tests/auto/render/renderer/tst_renderer.cpp Change-Id: I76633bc5a5a065e5f9ea62cc16563377e5c693a3
| | * | Move calculateBoundingVolumeJob dependency on updateTreeEnabledJob5.10Svenn-Arne Dragly2018-02-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move it to renderBinJobs because we clear all dependencies of calculateBoundingVolumeJob at the start of this function. Change-Id: Idebe10349181d95813e47e85b2e6f4f2ae39e615 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * | Proceed to the next frame even if we cannot lock the surfaceSvenn-Arne Dragly2018-02-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if the render surface could not be locked or makeCurrent failed, the aspect thread would be stuck waiting for the next frame and the render thread would be stuck waiting for the render jobs. This change makes sure both threads continue, which will allow changes to the surface to be synchronized and make the render thread try to lock the surface again. Task-number: QTBUG-66243 Change-Id: I01bbe4c2ca74961f363efbe87c0586edaad41c62 Reviewed-by: Harald Vistnes <harald.vistnes@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * | QAbstractCameraController: Make struct InputState publicFriedemann Kleint2018-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For generating Python bindings, the struct InputState needs to be public since a Python binding needs to be created for it so that a wrapper of QAbstractCameraController can be generated that calls into Python for an implementation of moveCamera(). Task-number: PYSIDE-487 Change-Id: Ib410b19a9e886ad06335dac05fd56206a72220bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>