summaryrefslogtreecommitdiffstats
path: root/src/render
Commit message (Collapse)AuthorAgeFilesLines
* Fix memory leakv5.10.0-beta3Jesus Fernandez2017-10-241-0/+1
| | | | | | | | | | | | The memory will not be reclaimed by the destructor, and it cannot be reused until the process terminates. In Qt3DRender::Render::NodeManagers::NodeManagers(): Constructor allocates memory but destructor does not free it (CWE-401) Coverity-Id: 184877 Change-Id: Ic1afa3d9c0270442ad0e2060acbdae01496463a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update render aspect skeleton's local posesSean Harmer2017-10-031-1/+6
| | | | | | | | This is the receiving side of the changes sent by the animation aspect. Not much to do as everything is already in place. Change-Id: I36a79868d28bab0cf71a176b175e5ea42727979a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2017-09-302-1/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/animation/backend/animationutils.cpp src/animation/backend/animationutils_p.h src/render/geometry/qmesh.cpp tests/auto/animation/animation.pro Change-Id: Ifb57bfb0b12b3ebf9ee177d4ea684134455b4143
| * Ensure meshName gets used in the functorSean Harmer2017-09-271-2/+4
| | | | | | | | | | Change-Id: I9015546607b5663f1feada64bc03cb73d3538ef2 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Copy size and pixelRatio when switching activeFrameGraphAnders Hafreager2017-09-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Copy externalRenderTargetSize and surfacePixelRatio from old to new surfaceSelector when setting activeFrameGraph on RenderSettings. Previously, when switching activeFrameGraph, surface was copied from old to new surfaceSelector, but these other properties were not. The rendered image was then stretched until window is resized again. Change-Id: I62b78da05c764f981813ab96b9a769bae7d786b2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Clear TextureData flag after texture uploadWieland Hagen2017-09-151-0/+1
| | | | | | | | | | | | | | Or else we will continue uploading data indefinitely Change-Id: If81d8a0a790964c699462fbcb166808ee7859f59 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | ES2 has gl_FragColor and not gl_fragColorKevin Ottens2017-09-271-1/+1
| | | | | | | | | | Change-Id: I4d22b177745b257950212e48fa550143813c4f6b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add phongFunction to the nodes prototypesKevin Ottens2017-09-271-0/+34
| | | | | | | | | | Change-Id: Iad0b51e19cc78683f18db0ae2718df6abd4ba72f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add ES2 rules for the worldSpaceToTangentSpaceMatrix node prototypeKevin Ottens2017-09-271-0/+9
| | | | | | | | | | Change-Id: I35c12c52a965a554b49cdb6ebb8f65658e8ecea3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add an aspectRatio standard uniformKevin Ottens2017-09-222-0/+4
| | | | | | | | | | Change-Id: I83e750c131ba070ce68b42a9837bd01dd064173c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Port away from QBuffer::typeKevin Ottens2017-09-221-1/+1
| | | | | | | | | | Change-Id: I910d1fa7099dc726e022cbf35702b0b58fbac64e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Deprecate QBuffer::typeKevin Ottens2017-09-225-13/+20
| | | | | | | | | | | | | | | | It can also be removed from the backend class, now the renderer doesn't look at it anyway. Change-Id: I5643922dccc81c0ee33f80e4b0ea34b63e51d89c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Rely on the attribute type for the binding pointKevin Ottens2017-09-222-16/+8
| | | | | | | | | | | | | | | | Stop reading the buffer type from the buffer object and instead use the attribute type to determine the binding point. Change-Id: I95856776297252c6e332f842c2b5362d1467e420 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Explicitly pass binding point on buffer creationKevin Ottens2017-09-223-13/+13
| | | | | | | | | | | | | | | | | | This way we don't rely on the buffer type member in those case, this can be all determined from the current context anyway. It also prevents forcing a single use for a buffer. Change-Id: I8c5ec3878bd36ddbfd257adfb218561d44f18823 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Hardcode a binding point for buffer downloadsKevin Ottens2017-09-221-1/+1
| | | | | | | | | | | | | | | | For downloading the data from a buffer, similarly to uploads, the binding point doesn't really matter so always use the same binding point. Change-Id: I5950e58ff8a0acc719ea784cdf2fb2370077c868 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Hardcode a binding point for buffer uploadsKevin Ottens2017-09-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | For uploading the data in a buffer, the binding point doesn't really matter so always use the same binding point. This is the first step toward finally deprecating QBuffer::type, this is going to be a long journey it seems. Change-Id: Icad36d35764cbc25d249a651b80ebbce6b34828d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge branch '5.9' into 5.10Sean Harmer2017-09-1218-152/+114
|\| | | | | | | Change-Id: Id6a3d4ec579a2f2a2e559c22a2293d0e184f0bdf
| * Fix bounding sphere pickingMike Krus2017-09-121-8/+12
| | | | | | | | | | | | | | | | | | | | In some cases, the list of pickable objects may contain entities that don’t have an object picker (or not parent has). Now filter the pick results to only keep entities which either have an object picker or are children of an entity that does. Added unit test which now passes Change-Id: I930c3d60cf2d19e845fe6c0de904c53b93ebe8be Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Get rid of the AllocationPolicy template argument in the ResourceManagerLars Knoll2017-09-116-33/+0
| | | | | | | | | | | | | | We always use the same policy anyway. Change-Id: I3349b8c19ce0e6239b140dfac7ba66f8dda1b9be Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Get rid of the HandleManager classLars Knoll2017-09-111-3/+2
| | | | | | | | | | | | | | | | | | Instead, direclty use the Allocator to acquire and release handles without an additional indirection. This removes around 30% of the overhead in run(). Change-Id: Ic4a9343dd52a900eb1c7eb6b4135bc7670076df1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix logic errorLars Knoll2017-09-091-1/+1
| | | | | | | | | | | | | | | | | | This should be removeAll instead of remove(). Remove takes an integer (index into the array). It compiles by chance (but doesn't do the right thing), as QHandle has a cast operator to int. Change-Id: If8d59a535021bab3d2553f83bef7cf769c738dd6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Make GLTexture dirty flags atomic instead of using a mutexWieland Hagen2017-09-082-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | The mutex right now is used for controlling access to the m_dirty flags, and for guarding access to m_gl and other data. We don't need to use it for accessing the flags, as an atomic int will do just fine and relieve us of potential deadlocks. The mutex must only guard changes to the actual data. Task-number: QTBUG-61130 Change-Id: Ia1f25af2233387f375c077965e901c67f972f1ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Properly handle byte strideWieland Hagen2017-09-081-1/+1
| | | | | | | | | | | | | | | | If a specific byte stride is given by the user, we should expect that he knows how the buffers look. Change-Id: I0ee9a92bf628d3f3fda935e9cd83e7c1150cd089 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Return the Uniform as a const reference to avoid expensive copiesLars Knoll2017-09-062-12/+2
| | | | | | | | | | | | | | And inline the nameId() and uniform() getters. Change-Id: I4c30a6fa36a6e5a7e621d3fad91d88adfcfda185 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix StringToInt implementationLars Knoll2017-09-062-47/+19
| | | | | | | | | | | | | | | | | | | | | | | | Reduces the overhead per call of lookupId() from around 7000 to 180 instructions for a use case. Should in general scale much better. I still do not like that this is using global static data that is never cleaned up. It should be tied at the minimum to the lifetime of the Qt 3D scene. Change-Id: I777a2bbf2d765f4b0fc9e3d2b06692c7260f5a9f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Improve performance of FilterKey comparisonSvenn-Arne Dragly2017-09-062-14/+10
| | | | | | | | | | | | | | Reduce the number of copies and make sure the types are compared first. Change-Id: I6bdd411b6e16ef0f92a32de9733d737aab73835b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * GraphicsHelperGL2: Remember to set raw byte sizeKevin Ottens2017-09-061-0/+25
| | | | | | | | | | | | | | | | | | | | | | If one ended up with this helper then the applyUniform would lead to a divide by zero for any type. As a side-effect, the support for more matrix types needed to be done for unit tests to keep passing. Change-Id: I66c8a2eb7e5617f2fed96c689cb4ebc024ef9853 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | New prototypes for QShaderProgramBuilderRenato Araujo Oliveira Filho2017-09-071-0/+135
| | | | | | | | | | | | | | | | | | | | | | Add new default prototypes that make more flexible for the apps to: Join two elements into one Join three elements into one Join four elements into one Cast an element into another Change-Id: I4544d3a193101a948b7017f2f12bd4f2d49ac892 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Initialize entity id in QPickEventPrivateMauro Persano2017-09-051-0/+1
| | | | | | | | | | | | Change-Id: Ic028e8bcd89c7d360eb088fc0cf7d8256f3948e3 Task-Id: QTBUG-62976 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Implement enabledLayers on ShaderBuilderKevin Ottens2017-09-042-1/+27
| | | | | | | | | | | | | | | | This is the backend counterpart to the QShaderProgramBuilder introduction of the enabledLayers property. Change-Id: Iecec5e9d1450c454f64c243f5f797c0d63e5f1ee Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Introduce enabled layers to QShaderProgramBuilderKevin Ottens2017-09-043-0/+34
| | | | | | | | | | | | | | | | This will allow to control the code generation by forwarding this to QShaderGenerator on the backend side. Change-Id: Ic613467ba742c05344ef553eabab861b2408d0ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QShaderLanguage to simplify protos and metal/roughKevin Ottens2017-09-041-217/+74
| | | | | | | | | | | | | | | | | | | | Thanks to those new enums and their support in the parameters system we can remove quite a few of the prototypes and give more expressivity in the material json files. Change-Id: I10780afca06c1c49e4bb99d90370abdc4c25919e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Simplify node prototypes JSON using parametersKevin Ottens2017-09-041-226/+93
| | | | | | | | | | | | | | | | | | Thanks to the parameters now being supported in the formats, we can simplify greatly the JSON file to have for instance a single sampleTexture prototype and not one prototype per possible texture name. Change-Id: I28f4f3e856f6cca0bbff579efb983bc13e0ea605 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge dev into 5.10Frederik Gladhorn2017-09-0210-19/+77
|\ \ | | | | | | | | | Change-Id: I1bef655947a7176f7931c7f1b8ed4c4176395451
| * | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-09-0110-19/+77
| |\| | | | | | | | | | Change-Id: Ic4220f9957266c374f751d3612c60b81e9cea193
| | * Don't create GL textures when format is not setMauro Persano2017-08-312-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For textures where the format was not set (this may happen, for instance, for a Texture2D without TextureImage children), don't try to create a GL texture or the underlying OpenGL calls will fail. Also avoid trying to set the corresponding uniform while rendering. Change-Id: I17d95e2a2f1f1a1e5c22a0296c8641c4873e9e7f Task-Id: QTBUG-62654 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Doc: add missing doc QGeometryNico Vertriest2017-08-301-0/+18
| | | | | | | | | | | | | | | Change-Id: I9d1fef3f793f9d3eb4ef0bb3fff356539fc03e2c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Fix hover event handlingMike Krus2017-08-301-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | HoverMove is not a QMouseEvent. So we generate a fake one and send it for picking processing. Task-number: QTBUG-58607 Change-Id: Iaa06bfe49494db1a46cc021747fd5d0026330525 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Doc: add doc to undocumented methods qt3dNico Vertriest2017-08-294-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qabstractlight.h:65: warning: No documentation for 'Qt3DRender::QAbstractLight::Type' qspotlight.h:64: warning: No documentation for 'Qt3DRender::QSpotLight::attenuation()' qshaderprogram.h:78: warning: No documentation for 'Qt3DRender::QShaderProgram::Status' qshaderprogram.h:121: warning: No documentation for 'Qt3DRender::QShaderProgram::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)' qpicktriangleevent.h:57: warning: No documentation for 'Qt3DRender::QPickTriangleEvent::uvw' Change-Id: Iedb73cc73bc28a5e9dd3498a0bb6547eb1a96ffc Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Don't dereference null vaoSergio Martins2017-08-251-2/+4
| | | | | | | | | | | | | | | | | | | | | RPI doesn't support vao Change-Id: Icfcf90c6aff53a73704cc36c215b7b452be86778 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Remove ill-timed viewVec-upVec check in QCameraLaszlo Agocs2017-08-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for parallel view and up vectors is well-intentioned, but it cannot be done this way: the view matrix is updated already after setting any of position, view center, or up vector. The (failing) check can thus be triggered right after setting a position or view center that (temporarily) results in a vector colinear to the (not yet final) up vector. Change-Id: I083200bf05582517880a88816b7987874810c2bb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Send joint names and local poses from render to animation aspectSean Harmer2017-08-302-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow the animation aspect to easily update the local poses of all joints in a skeleton without needing to be able to address any frontend QJoint objects. Change-Id: Id2137f2533702387dc68296aba1dd8627b0599d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Factor out local poses into their own vectorSean Harmer2017-08-305-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | To make it easier and more efficient to send all the local poses for a skeleton between aspects. Change-Id: I68bf374a7d466f606f8979fdbf84cb697a47a8a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Add name property to QJointSean Harmer2017-08-303-9/+17
| | | | | | | | | | | | | | | | | | | | | And set it from the backend when creating frontend joints. Change-Id: I26d37c7f516944eb353af38716aab4c55bd2f79f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Store joint names in their own vectorSean Harmer2017-08-304-4/+13
|/ / | | | | | | | | | | | | | | | | This makes the JointInfo vector smaller (better cache performance) and also makes it cheaper to pass the joint names over to the animation aspect in a following commit. Change-Id: I1a892c1639dc055757906179d2fab89aad5fa81c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | BlitFramebuffer framegraph nodeJuan José Casafranca2017-08-2328-4/+890
| | | | | | | | | | | | | | | | This node allows to copy the content from one FBO to another or to screen Task-number: QTBUG-58162 Change-Id: I6016c46d9d538a012c2f641116ed766dd70ad021 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Don't call deprecated QImage::byteSize() functionSean Harmer2017-08-221-1/+1
| | | | | | | | | | Change-Id: Ib2c1150e4612b378e5b04d0ea424f38af2c434c2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | RenderQueue: make it hold its mutexPaul Lemire2017-08-226-22/+13
| | | | | | | | | | | | | | Allows to slightly clean up the renderer and remove things from the past. Change-Id: I04da9c4f9039df0de22e4da1dbd9193741e92a4d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge branch '5.9' into devSean Harmer2017-08-1940-175/+575
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp src/render/backend/renderview.cpp src/render/graphicshelpers/graphicscontext_p.h src/render/graphicshelpers/graphicshelperes2_p.h src/render/graphicshelpers/graphicshelpergl2_p.h src/render/graphicshelpers/graphicshelpergl3_2_p.h src/render/graphicshelpers/graphicshelpergl3_3_p.h src/render/graphicshelpers/graphicshelpergl4_p.h src/render/graphicshelpers/graphicshelperinterface_p.h src/render/jobs/pickboundingvolumejob.cpp tests/auto/animation/clipanimator/tst_clipanimator.cpp tests/auto/auto.pro tests/manual/manual.pro Also disabled the QQmlMetaType codepaths following commit 49a11e882059ee1729f776722e085dd21d378c36 in qtdeclarative. The QQmlMetaType codepaths will be re-enabled once a qt5.git integration has succeeded. Change-Id: Ia654d75425e6d406c472d19864383612208cad2b
| * Fix qml signal documentation for QObjectPickerPaul Lemire2017-08-181-35/+62
| | | | | | | | | | | | | | | | Also align everything properly Change-Id: I7948670912f3d321829ee1af90ebcb2497b6f98f Task-number: QTBUG-61996 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>