summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Perform the prepareUniform step when building the commandsPaul Lemire2020-04-203-7/+4
| | | | | | | | | | | | | | | | | | | | | | This is something we might as well parallelize rather than only doing them in the single threaded blocking rendering step. This gives a me a 3fps gain on bigscene-cpp whose bottleneck is still the submission currently. Change-Id: I4d7f3bfd395eef9fef6dc18f30445cfa7d6145ee Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Cleanup setShaderAndUniformsPaul Lemire2020-04-208-79/+144
| | | | | | | | | | | | | | Similar to what was done for the rhi plugin Change-Id: I266a3992e21faa2633036c809e884d91d4d892da Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Add missing job count to properly compute number of RenderViewCommandUpdaterPaul Lemire2020-04-201-1/+1
| | | | | | | | | | | | | | | | | | The job count was added as a recent refactoring. It defaults to 1 and therefore doesn't parallelize anything. Therefore make sure we override the value by the actual amount of jobs. Change-Id: Id2bc7ca0c10b292fa537c221ad4b90894d9b47fb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Animations: fix race condition on running clip animators vectorPaul Lemire2020-04-202-15/+12
| | | | | | | | | | | | | | | | | | | | | | Was caused by incorrect dependencies on the jobs. Introduced a clearDependencies on QAspectJobPrivate to clear all dependencies as removeDepencies(emptyVector) only removes null dependencies. Change-Id: I8119a9edaf841db6c5ab2a971dc5640da2192cba Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Clean up filter debug outputMike Krus2020-04-163-3/+28
| | | | | | | | | | Change-Id: I01c9448aab2dcebab9a025b2248e491fd92fd0af Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Shader: check frontend node still exists before synchingPaul Lemire2020-04-152-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Since backend shaders might outlive their frontend counterparts when using the OpenGL renderer (we need 1 more frame to properly cleanup shaders), check they still exists before trying to send changes. Also make sure we unset the send changes flag when we cleanup a backend shader Change-Id: I3d9cee13fa66e346e040f3be35de223c9081267e Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Animation: remove unused m_drityChannelMapper vectorPaul Lemire2020-04-142-4/+0
| | | | | | | | | | | | | | Avoids wasting time adding to it given it's not used. Change-Id: I7a3f30a7d56cb34bb60c79661aee0061c0dcb577 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Animations: prevent FindRunningClipAnimatorJob from running every framePaul Lemire2020-04-146-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The job it does takes a fair amount of time and only needs to run occasionally. We would reset the normalized time on the backend node every frame which then lead to a dirty set being set when synching again with the frontend. This might not have happened every frame prior to the synching refactorings. However currently, after every animation step, the dirty set would be reset and the job scheduled to run again even though nothing had really changed. This patch fixes that by setting the normalized time on the backend node prior to the synching with the frontend. That way, when we sync with the frontend the values are either identical when playing the animation unless the user really has changed the normalizedTime value. Change-Id: Iade4e7bfd47d34ef083d8e3398180a71630c0c81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Adjust number of jobs based on number of render pathsMike Krus2020-04-148-73/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renderer currently creates a large number of jobs, most of them doing nothing, this quickly adds up when we have lots of branches. To keep those down, we adjust the number based as estimate of branches that have work to do (no draw detection will fail if it's not the leaf node). Also make RenderViewCommandBuilder and MaterialParameterGathererJob only run if necessary (and reset instance counter on each frame). Finally, only create the right number of MaterialParameterGathererJobs for the amount of updates required. Change-Id: I2d38c72589a38445d0110fc22a472fb9482d1a03 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | setShaderAndUniforms: small improvementsPaul Lemire2020-04-141-27/+30
| | | | | | | | | | | | | | | | | | - try to reuse computed results - only set either the loop or unloop uniforms, having both at the same time isn't possible Change-Id: If11eef32f42f639e6da6c9b3cc693f42c2e86cad Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | GLShader: store lights uniform name ids in their own vectorPaul Lemire2020-04-146-96/+538
| | | | | | | | | | | | | | | | | | | | | | | | The lights uniforms are set automatically by Qt3D. Therefore, it makes sense to to only iterate on uniforms that have been specified by the material thus reducing the amount of elements to iterate over. Reduces the amount of CPU cycles spent in setShaderAndUniforms by about 3% Change-Id: Ic758510775d0d86b19567e8345af51ce84cfc4d9 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | setShaderAndUniforms: use const ref for vectorsPaul Lemire2020-04-142-10/+10
| | | | | | | | | | | | | | | | | | | | This avoids the ref/deref that a copy does on const QVectors which internally results in less atomic integer operations. The gain seems significants: 2.5ms faster when iterating over 1000 iterations Change-Id: Ie09b0e2755cc1800a424bc5a446ae0a77da1733c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Reserve the correct amount of uniforms in shaderparameterpackPaul Lemire2020-04-143-2/+15
| | | | | | | | | | | | | | | | | | According to hotspot, that small changes makes setShaderAndUniforms (our biggest hotspot) drop from 45% of total sample cost down to 40% by getting rid of frequent QVector reallocs. Change-Id: Iba94eacee8f4349201acc399432c8c38f325c1d1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Add benchmark for ShaderParameterPackPaul Lemire2020-04-141-0/+6
| | | | | | | | | | Change-Id: I05e42f7fdfb6b54c30299b7e6664a48f61116b28 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | QRenderCapabilities::API add new API valuesv5.15.0-beta4Paul Lemire2020-04-081-2/+5
| | | | | | | | | | | | | | | | To match with QGraphicsApiFilter and give use a chance to report if we are using them later on. Change-Id: I5858c36596da92c4d0da1f1cf31db6be6de48286 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Update plugins.qmltypes for 5.15Jani Heikkinen2020-04-088-16/+119
| | | | | | | | | | | | | | Task-number: QTBUG-82253 Change-Id: I64a804c306e06076f185ffaf422a1cb1f93b055b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Be less aggressive in how materials are marked dirtyMichael Brasser2020-04-061-6/+10
| | | | | | | | | | Change-Id: I8503a35506eaa9d80dd089fa742eabdc6015f194 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Don't look up backend node if frontend not updated yetv5.15.0-beta3Mike Krus2020-03-311-0/+2
| | | | | | | | | | | | | | | | | | If node parent / child or entity / component changes before the backend nodes where created, records might not be complete yet. Task-number: QTBUG-82269 Change-Id: Id8238410331626130bb71bb1653ac5cb5d5270d4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Disable sorting commands by textures on WindowsPaul Lemire2020-03-301-0/+2
| | | | | | | | | | | | | | | | | | | | As it leads to a runtime assert based on the fact that the sorting predicate might return true for (a, b) and (b, a) This disables that part until it is rewritten properly. Change-Id: I0e90d02583d402599e7a38bf0c5cca6f2460a9a8 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Properly stop running animations when using a negative playratePaul Lemire2020-03-304-9/+18
| | | | | | | | | | | | | | | | When reaching a normalized time of 0 they would otherwise continue to run Change-Id: Idaea755d3a12f9c9da9c25732c2221e9b3f9f4c7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix job dependenciesMike Krus2020-03-271-4/+6
| | | | | | | | | | | | | | Got dropped in previous refactoring Change-Id: I4fdffd329f79b2a650c4780b693a665f81a9770b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Compute stride if not specified for pickingMike Krus2020-03-271-2/+20
| | | | | | | | | | | | | | If stride is 0, compute based on value type and size Change-Id: I32ffecd1fd0a913fa45fd5d295abbcdfd46f6ff5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Implement MetalRough shader optimization TODOMichael Brasser2020-03-275-20/+9
| | | | | | | | | | | | | | Calculate specularMipLevels only once, on the CPU. Change-Id: I694e3d5e45ea369875ac3ecff36f885b3f669bcf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add ability to dump filter statesMike Krus2020-03-266-5/+162
| | | | | | | | | | | | | | | | | | | | | | Add button in overlay UI to dump: - the details of technique and render pass filters in the render views - the details of technique and render pass keys in the scene graph This is useful to understand why some objects are not rendered. Change-Id: I57a284081ec986e49e90c979042cc0c17ee0d1cf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Make Scene3DItem accept hover eventPaul Lemire2020-03-261-0/+1
| | | | | | | | | | | | | | Otherwise we can't use hove events on things like QObjectPicker Change-Id: I50fcc8d02efda7792f2d35ea3dc461e5256efc5b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix documentation formatting for UnderlayMichael Brasser2020-03-241-2/+0
| | | | | | | | | | | | | | | | | | \value breaks on blank lines, which led to the Underlay docs spilling out of the table. This lumps them all into a single paragraph, which still isn't ideal, but helps clarify where they belong. Change-Id: I9a64e1062a9d3f4d785bc44a538fa966239c06e8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix crash in rendercapture-cpp manual testPaul Lemire2020-03-232-18/+20
| | | | | | | | | | Change-Id: Id4ad6552fc1a254bd9414bab63400d624e902442 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Don't skip RV which have a RenderCapturePaul Lemire2020-03-231-0/+3
| | | | | | | | | | | | | | | | Even if they are no actual RenderCommands, we still want to perform the RenderCapture. Change-Id: I8219bf750d5664d2954c05722c9eb2b1562c11a0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix scene graph dumpMike Krus2020-03-201-8/+9
| | | | | | | | | | | | | | Might have QNodes "between" parents and child entities. Change-Id: Ie041508ec96c39b779bc75a6ad4d38c604e322e2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Move shadergraph to Qt3DJean-Michaël Celerier2020-03-1919-7/+2904
| | | | | | | | | | Change-Id: I3ed10747175a58513933b29eac66ddf92fe87d07 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Implement Mouse Click and Double Click on MouseHandlerMike Krus2020-03-192-3/+5
| | | | | | | | | | | | | | | | Looks like it actually never worked. Task-number: QTBUG-75219 Change-Id: I54e7c58be57c41461c95c48ec3e76aa45bf340a1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | CameraLens::viewMatrix() remove qDebug which has a noticeable performance impactPaul Lemire2020-03-171-2/+0
| | | | | | | | | | | | | | | | Amounts for about 0.5% of CPU cycles over a long application run even though we might not even be displaying it Change-Id: Ia20eb48f461e8aa598fab0c52cbed57ca31ca7ec Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Make QAspectJobPrivate::isRequired() constPaul Lemire2020-03-178-20/+19
| | | | | | | | | | Change-Id: I8747c5714b4a25523835d558fa96888ea0ebcfed Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Initial creation of RHI plug-in and refactoringJean-Michaël Celerier2020-03-1670-29/+13887
| | | | | | | | | | Change-Id: Ifbb51003e15f798798040597b5f7224641e8147c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add missing QPainterPath includesUlf Hermann2020-03-112-0/+2
| | | | | | | | | | | | | | Change-Id: I315a4b0615830ae32915a3c2e0ff6ad54b6d15fd Fixes: QTBUG-82792 Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Allow Qt3DWindow to choose which graphics API to use on constructionJean-Michaël Celerier2020-03-119-13/+140
| | | | | | | | | | Change-Id: Id3ff72a2eaa7f85844a546ef55dc3e1b71a14659 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add missing documentationMike Krus2020-03-103-2/+468
| | | | | | | | | | Change-Id: I68d386671c271462a4b156ba9e0f61222a9c79c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge gatherer and caching jobsMike Krus2020-03-065-75/+45
| | | | | | | | | | | | | | Avoid extra thread sync just for copying data around Change-Id: Ib119115bbb3a7a8a2aa99a3e271595caecc371f7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Move common job handling out of RendererMike Krus2020-03-0610-243/+273
| | | | | | | | | | | | | | | | | | Should be done in aspect as it's independent of the backend. Moved some tests to separate test using an empty renderer as other backends are likely to have different jobs. Change-Id: I2bec0939045acea7b91ecb1622ba18bf9f5db3c6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Doc: Fix incorrect use of \default QDoc commandTopi Reinio2020-03-054-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The command, despite its name, does not document a default value of a property or a parameter. Instead, it's specific to QML properties, marking a property as a default QML property. Replace incorrect use of the command with descriptions of default values. Fixes: QTBUG-82645 Change-Id: I5b457062ffe2e8d81c358119e6bebc11b0063090 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Fix memory leaksMike Krus2020-03-043-9/+24
| | | | | | | | | | | | | | | | | | | | | | Some jobs get skipped because they don't have anything to do. However, since the runnable does not get submitted to the pool, it would leak (along with the job it points to). Also fixed a couple of compile warnings. Change-Id: I7a25649f2f760c0593862328c0ab905da98c982a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Reduce concurrency in bbox evaluationMike Krus2020-03-031-109/+154
| | | | | | | | | | | | | | | | | | | | | | Previous code created a list of all entities in the scene graph and iterated on that, ignoring the not-dirty ones. This now only collects the dirty ones before iterating on the resulting list. Should greatly reduce concurrency in large scenes. Change-Id: I838a5c9f8e6eb6d35b057a01c8a02585665599f0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-273-6/+6
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I685be5c4f16e7acfb38deafe3b92cfadb3a42188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Fix typo in updateAxesContinuouslyKai Koehne2020-02-261-2/+2
| | | | | | | | | | Change-Id: I34233db4540c7f6d31cc508ad541cd4d682a08ec Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Remove GL tracing optionMike Krus2020-02-251-13/+10
| | | | | | | | | | | | | | and reorganise the UI for consistency. Change-Id: I68070d8f2d6416c59074d85028c693a2be663608 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Revert "Replace deprecate QNetworkReply::error() call"Timur Pocheptsov2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 34cb77c210316dd254a8aa27052fb03223e3f7af. Naming in QProcess is considered to be the correct one and the rule. Change-Id: I75f267b4f8dcc991b0d4945752b48de1b4e5b386 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Show non-required jobs as dottedv5.15.0-beta1Mike Krus2020-02-171-0/+6
| | | | | | | | | | | | | | | | Jobs that are in the graph but will not be scheduled (because they have nothing to do) are showed in dashed line Change-Id: Ia5d3b1b2b17d55820965b473099c0363cb645daf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Make sure RenderViewCommandUpdaterJobs only run when necessaryMike Krus2020-02-172-1/+31
| | | | | | | | | | | | | | | | | | | | | | There's a large amount of those and they don't seem to have much to do, so only actually schedule them when necessary. Also reset the job instance counter to zero after each frame, helps counting how many they are in the graph dumps. Change-Id: I9bbc30f8277ed4204a4150eddd68b36396965281 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix and improve FBO handlingPaul Lemire2020-02-175-29/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | FBO need to be rebuild when one of the attachments directly or indirectly changes. By direct change we mean one of the FBO attachment texture being resized or the list of attachments changing. By indirect we mean when texture resource is recreated internally by the engine. Failure to handle this cases resulted in FBO referencing invalid attachments. Change-Id: I8dd4c08e464eed7fb0eeefd61a4158304ab4245f Task-number: QTBUG-64757 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix job dependenciesMike Krus2020-02-141-0/+1
| | | | | | | | | | Change-Id: Iacfa40bf887e4846450da5cc1983d35be42b8e81 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>