summaryrefslogtreecommitdiffstats
path: root/src/render
Commit message (Collapse)AuthorAgeFilesLines
* Add support for synchronous pickingMike Krus2020-07-3010-25/+149
| | | | | | | | World space and screen space raycasters gain method to do a pick query synchronously, returning the list of hits. Change-Id: I41cc3940b8d97c3619456d76127841907a9170cb Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Refactor Scene3D to work with both RHI and GL Qt3D renderersPaul Lemire2020-07-294-28/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Depending on whether we are using RHI or GL we need to either trigger the rendering after the beforeRendering or beforeRenderPassRecording have been fired -> beforeRendering The RHI command buffer is set up but nothing has been recorded yet. This is what we want for the RHI backend but we will need to make sure we don't call begin/endFrame nor use swap chains other than the one QtQuick is using. This means RenderSurfaceSelector won't be possible. -> beforeRenderPassRecording The RHI command for buffer uploads have been uploaded but the actual RenderPass draw calls have yet to be made. The screen has been cleared already, so this is the best place for the GL backend which expects the screen to have been cleared. - The GL backend can use a QOpenGLFrameBufferObject but that is not possible with the RHI backend. - The RHI backend uses a custom QRhiRenderTarget that takes care of blitting its color attachment into a QRhiTexture which is then bound to a QSGTexture The overall Scene3DItem/Scene3DRender architecture remains the same: - processChange - Render Qt3D content into Texture - Set texture on a custom QSGNode quad Change-Id: Id6c317342d0a227d5295cbfefefc3ed12da160d7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update buffer visitorMike Krus2020-07-271-165/+10
| | | | | | | | Optimize iteration in non-primitive-restart case; remove code duplication. Change-Id: Ie459485c1cefc51956029e56e266a98c17d5b038 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix vS2019 build issuesMike Krus2020-07-201-1/+1
| | | | | | Change-Id: I5af5b180f7b07b885e613c20b84b9904d6906ed5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use QList instead of QVector in renderJarek Kobus2020-07-09102-320/+312
| | | | | | | | | Use list-initialization. Task-number: QTBUG-84469 Change-Id: I826450646fc3c7118cae49c22a28058f47770e13 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move RenderViewInitializer,Builder/Updater jobs to a common placePaul Lemire2020-07-085-2/+403
| | | | | | | | | All the renderer plugins are doing differently really is the submission part and the way commands are built which we can hide entirely in the RenderView/RenderCommands Change-Id: If4d6a472f1ce1b36ffa5b4ca75e3420e42a165f5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Isolate picking event processingMike Krus2020-07-084-117/+137
| | | | | | | | Can then be reused for synchronous event processing and for letting individual object pickers override picking settings. Change-Id: I7d71522dabc20f35956c23ae169d9b06fb86bdb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use QList instead of QVectorJarek Kobus2020-07-0731-69/+69
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic726ce85e01190dbc64426388fd454c54ae3c3e3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move and adapt RendererCache to share amongst renderer pluginsPaul Lemire2020-07-073-1/+212
| | | | | Change-Id: I4e6e48abdd79b59fe98a916c7f2da6ba92e8ff82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GLTexture: change internals to use std::vectorPaul Lemire2020-07-071-2/+2
| | | | | Change-Id: If680702aed4544395866a7b376db920561bf16cc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderQueue: reset now destroys RenderViewsPaul Lemire2020-07-071-0/+2
| | | | | | | | This makes things tidier by tying RenderViews lifetime to current RenderQueue. Change-Id: I35ef5761cf987582c361d700efce8ef06231ff38 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Refactor RenderQueue so that it can be shared between renderersPaul Lemire2020-07-073-1/+164
| | | | | | | It is now template based, header only Change-Id: I130ad84adce0638329f9d9fd7cfbf1608a7627f4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Share code between renderer pluginsPaul Lemire2020-07-0710-2/+1104
| | | | | | | | | | - MaterialParameterGatherer is common to both - FilterCompatibleTechniqueJob is common to both - RenderViewJobUtils refactor to only contain code common to both - UniformBlockValueBuilder moved to dedicated file, shared with both Change-Id: I634e6d60eb9a213dd6a0d5abd8ac53710bff1417 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* OpenGL Renderer: replace std::find by Qt3DCore::containsPaul Lemire2020-07-072-6/+4
| | | | | | | More concise and easier to read Change-Id: I67d93ff213842cfcc0263e244d89ba1e9a73982b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderQueue: switch to std::vectorPaul Lemire2020-07-033-8/+5
| | | | | Change-Id: I49ab3985ee01e40950bcd981dc77139a28f8db6a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* PickBoundingVolumeJob/RayCastingJob: switch to std::vectorPaul Lemire2020-07-039-53/+80
| | | | | Change-Id: Iad29450706dacef966e749ff964172a19d54dcfb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GraphicsHelpers/GLShader: switch to std::vectorPaul Lemire2020-07-038-19/+21
| | | | | Change-Id: I8be6695e0c52dfbe353cd381d94548aba1c7da82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* APIShaderManager: switch to std::vectorPaul Lemire2020-07-031-12/+28
| | | | | Change-Id: Ied22ef9dea4cd3043f9f3d5ec69d7628e60b7dd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* AttachmentPack: use std::vectorPaul Lemire2020-07-032-8/+8
| | | | | Change-Id: Iba6a5ca2a1b7f5bb1d93d1e406f23f31f6f1efd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-026-29/+29
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix crash when picking entity with boundingPositionAttribute setVolker Enderlein2020-07-011-2/+0
| | | | | | | Fixes: QTBUG-85356 Pick-to: 5.14 5.15 Change-Id: Ic989598132bf88ebfad9a5759c11dd27d433592a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Input Aspect: Dispatch events directlyMike Krus2020-07-011-1/+0
| | | | | | | | | | | | | Rather than accumulating events during a frame, they are now directly delivered to the device handlers synchronously. This removes the need to use jobs for updating the nodes. Updating axis and logical devices remains done using jobs at every frame. Change-Id: I2853a72cfe68201d8a6eb44d37bc64c9f50efd4f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renderer: move QVector to std::vector changesPaul Lemire2020-07-015-28/+35
| | | | | Change-Id: I99a55a52da55b9b8c32e0db8e47932a4eb2820fa Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Render aspect: Dispatch events directlyMike Krus2020-06-307-28/+53
| | | | | | | | | | | | Events now delivered directly to the input aspect which dispatches them appropriately. The picking job still accumulates events within a frame. However, this opens the door to synchronous picking and event propagation control later on. Change-Id: Ic525bdce4e3d30455558fce9e385331364e49026 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Switch to std::vector in QRenderAspect backend and OpenGL rendererPaul Lemire2020-06-3014-35/+38
| | | | | Change-Id: I91dd69fc205401b12f333a9a0534d9612c8e24f8 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix boundingVolumePositionAttribute handlingVolker Enderlein2020-06-251-27/+31
| | | | | | | | | | This patch fixes a crash when using setBoundingVolumePositionAttribute on geometries with indexBuffer. Fixes: QTBUG-85131 Pick-to: 5.14 5.15 Change-Id: Ib5d5e71412daf3b032fc85105cab858c3a937174 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Buffer: only remove references if createdPaul Lemire2020-06-251-2/+4
| | | | | Change-Id: I7001061af77ddbe61f23a2a7cdd4b7d849f715df Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: allow to enable Vulkan validation with an environment variableJean-Michaƫl Celerier2020-06-251-12/+7
| | | | | Change-Id: I2db9fcde4dbe3267a7b8d5368c184d52405d72e6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Private export RenderBackendResourceAccessorPaul Lemire2020-06-251-1/+1
| | | | | | | Needed to compile with address sanitizer Change-Id: I432ba705baa33b5b211237ea95c75ad2af79ba0b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make sure computed radius is positivePaul Lemire2020-06-251-1/+1
| | | | | Change-Id: Iad406bb6f5713606b54c50fd1013f57727a7a3e7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update dependencies on 'dev' in qt/qt3dQt Submodule Update Bot2020-06-241-0/+1
| | | | | Change-Id: I1e62b901adc2896129aab7ff714ca8bd3e762d69 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-249-14/+14
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I2e126d0be8efa0aa89c4a91a681b549f38c8cec4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean input event handlingMike Krus2020-06-233-13/+5
| | | | | | | | | - Clean up header dependencies - Remove EventSourceSettingHelper as threading is no longer an issue - Remove some locks which are no longer needed Change-Id: I071173d3b4c681f5420bd7a1f4cb13f80a9c9b2f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix AVX2 AlignedAllocatorPaul Lemire2020-06-194-84/+1
| | | | | | | | | | | The allocators should also be part of the SIMD specific files that have special compile flags. Use this opportunity to move aligned_malloc from Qt3DRender to Qt3DCore so that any file in any module relying on it gets the proper compile flags. Change-Id: I7e18aeb195e9d34d4917be4ecccabfd82e40c0dd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove the OpenGL Render ThreadMike Krus2020-06-1911-218/+43
| | | | | | | | | | | | | | | | | | | | We're trading a bit of performance at submission (since we could start preparing the next frame while submitting the current one) for convenience and ease of maintenance. Besides, this allows to remove a thread and in cases Qt3D was used with Scene3D, which is likely the majority of cases, the RenderThread was not used anyway. To control whether the QRenderAspect should submit on its own or not, a new Submission type enum with values Automatic/Manual was added. This allows the QRenderAspect to automatically perform command submission when Qt3D is used on its own. For other cases when Qt3D is integrated into a 3rd party engine or with Scene3D, the Manual mode is used to let the QRenderAspect render only when it is told to do so. Change-Id: Idc270b5a07bcb9ea9e61674a69c6b8cf6ccd8182 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Handle config flags to turn aspects on or offMike Krus2020-06-183-32/+0
| | | | | | | | | Also restores RHI option but it's off by default. Moved render module config to renderer plugin folder as those are the only options for now. Change-Id: Ie102e5b9365b3bea8f4bc97cb76b3a19851b1fa5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix compile warningsMike Krus2020-06-172-6/+6
| | | | | Change-Id: Ibb17168e1c75c4802764e2ccfb3dd6d8257402dd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix handling of SSE/AVX sourceMike Krus2020-06-172-2/+4
| | | | | | | | | | | | | | | | QtBase has macro to enable SSE handling on specific source files. But Qt3D has some classes which use those specific instruction set in headers, so any file that includes those should also have the right command line options. This adds the right command line arguments to the 3DCorePrivate target so that anything that depends on that will have the right options. 3DCore is fine because it knows about the special headers files which were tagged. Change-Id: Ia061750121fb2ab5c93600c08a5464179ca2c228 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Qt6: Port Qt3D QStringRef to QStringViewKarsten Heimrich2020-06-101-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: Iee0ba69dcd754956815e7be94521f8bbee667829 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compile warnings related to deprecations or unused variablesPaul Lemire2020-06-083-4/+4
| | | | | Change-Id: I3d8fa0940a22f40bec3809b302cc59a40a5c3c52 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix QBuffer::updateData being called several times in a rowPaul Lemire2020-06-081-7/+11
| | | | | | | | | | | | QBuffer::updateData would send a single update at the time and would overwrite the latest update if it was called again before synching with the backend took place. This patches fixes by storing a list of pending updates instead. Change-Id: I1fc501ad921c953ec88117fcc49c0cfcde6ca8aa Task-number: QTBUG-81921 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix a QString::arg() placeholderGiuseppe D'Angelo2020-06-081-1/+1
| | | | | | | | | A placeholder was accidentally repeated, causing warnings (and wrong debug output). Change-Id: I2c09a538bf1a4b39e926fa9a8d1e6d991f524e01 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rework ShaderData/UniformBlockValueBuilder to minimize String lookupsPaul Lemire2020-06-082-30/+94
| | | | | | | | | | We cache the names used for a given Block/Struct for each ShaderData so that we don't have to concatenate strings all the time Also removed the local thread storage which we don't need and update tests. Change-Id: I934c78f7f69cb85017d684ae30e5b0cb632d3fa0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Link pthreads for stringtointMike Krus2020-06-051-0/+8
| | | | | Change-Id: Ia75ddb2d198c28a87fccd3e3b7d67bce9c6145d2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix some more compile warningsPaul Lemire2020-06-041-1/+1
| | | | | Change-Id: I5c42d2be7d06388609c46f9becaf147f7ce8d6ae Reviewed-by: Mike Krus <mike.krus@kdab.com>
* StringToInt: use std::shared_mutex instead of QReadWriteLockPaul Lemire2020-06-022-12/+12
| | | | | Change-Id: I1614fab80760caa27cf3350deb256c4e766aecd6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add missing overrideAlexander Volkov2020-05-252-2/+2
| | | | | Change-Id: I6a2a4577b4c45d7ac601d2693044c3817e245111 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for building with CMakeMike Krus2020-05-223-0/+376
| | | | | Change-Id: If6c887c6356a160a5f3fb906d38a341fff0c7b29 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QResourcesManager: switch to std::vectorPaul Lemire2020-05-207-8/+8
| | | | | | | | | Given QVector is potentially slower for this use case and the fact that QVector might become QList in Qt6, we're better of using the std. Change-Id: If2c403439ddb856b60f8bfd5ae7c6ec1cb2c892a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Return children handle by referenceMike Krus2020-05-197-7/+7
| | | | | | | Avoid shared container ref counting Change-Id: Ifca20cc02ded49740484fdb977de56f93f4ddd41 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>