summaryrefslogtreecommitdiffstats
path: root/src/render/renderers/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Uniform: add handling of uniform of Image based typesPaul Lemire2019-06-055-1/+264
| | | | | Change-Id: I94adc182a0f744b022fb13f4e2dbd16e47e2ba71 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* GraphicsHelpers: add bindImageTexture supportPaul Lemire2019-06-0415-1/+110
| | | | | | | Since GL 4.2 and ES 3.1 Change-Id: I3feaaa6e34b3031121771017763d51ac6ef07687 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Scene3D: Revise render loop and synchronizationAnton Kreuzkamp2019-05-281-0/+1
| | | | | | | | | | | | | | | | | | Before, the Scene3DRenderer marked the sg-node dirty in render, which would then already mark it dirty for the next frame. This only works as long as we always render, which is undesireble in some cases. fa12f14b2 changed rendering to not always happen anymore. Thus, that commit broke rendering under certain circumstances. Now, Scene3DRenderer listens on a signal from the QChangeArbiter about new pending changes. In reaction to this signal, we set an internal dirty-flag in Scene3DRenderer. Only if this flag is set, synchronization and rendering will happen on the Qt3D side. Change-Id: I3b33faa5d60c270bd9b903b0e34c8fa24e2e29fd Task-number: QTBUG-69985 Task-number: QTBUG-72923 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Eradicate Q_FOREACH loops and mark the module cleanMarc Mutz2019-05-221-3/+0
| | | | | | | | | | The only noteworth change is where a loop around spy.events modified the container using takeFirst(). There was no reason to do so, so it was changed to use the loop variable instead of the result of taking. Change-Id: I02c62a7c2efc5d042c6e669fe5daddd7da7e85d2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-181-1/+1
|\ | | | | | | Change-Id: I830139030c589f9f9354223dc9a73dbe3e137532
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-05-131-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp Change-Id: I27de9b83fa6ef6bb319e4b11c932f91f9ff92dc3
| | * Fix number of lightsMike Krus2019-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When an environment map is in use, no extra light is added and the count should be 0. Change-Id: Ieb14c48dd9627530b7b7b0682a20096237635d4d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devPaul Lemire2019-05-092-3/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/abstractrenderer_p.h src/render/renderers/opengl/renderer/renderer.cpp tests/auto/render/renderer/tst_renderer.cpp Change-Id: Ib6da858f10bec57bdb1002bd8fa4172304d118f2
| * | Merge remote-tracking branch 5.12 into 5.13Paul Lemire2019-04-265-40/+215
| |\| | | | | | | | | | Change-Id: I42affdd02bddb5205b9f2455f0c5e5efbd414dd8
| | * Cache light/renderable/computable vectorsJames Turner2019-04-104-37/+197
| | | | | | | | | | | | | | | | | | | | | | | | This avoids running these jobs when lights / renderables have not changed in a frame Change-Id: I604180fe3442ab67648c4ba5d9effb8639c68ef7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Fix Entity parenting hierarchyJim Albamont2019-04-042-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the initial Entity backend node hierarchy is created it skips over any non-entity nodes to ensure that Entities are only parented to other Entities. Calling QNode::setParent breaks this when reparenting Entities to non-entity nodes. Fix by sending a new "parentEntityUpdated" property update that backend Entity nodes listen for. They keep the id of their new parent and flag the need to rebuild the entity hierarchy. This triggers a new job to clear the children and parents of every backend Entity, then rebuilds the hierarchy using the stored parent ID in each Entity. This is much more forgiving of creation/parenting ordering issues and shouldn't be less performant because any Entity reparent was previously marking everything dirty anyway. Add a new test from QTBUG-73905 that creates 4 cylinders and manipulates the parents in different ways. Add a new test to tst_nodes to reparent a QEntity to a QNode and ensure the entity finds it's correct QEntity parent. Add a new test to tst_entity to ensure backend nodes correctly handle the new parenting events. Task-number: QTBUG-73905 Change-Id: Iab0203947d89bbed2868b3629fbde879675fe568 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Merge remote-tracking branch origin/5.13 into devPaul Lemire2019-04-1513-238/+382
|\| | | | | | | | | | | Change-Id: Ib5c04e9941aeea1a4cd27519b94b9a53e8349ea3
| * | Switch export macros to standard formKai Koehne2019-04-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt expects the export macros to have Q_ prefixes, otherwise the symbol versioning script won't find them and mark them. Also remove non-exising QT3DLOGIC_PRIVATE_EXPORT macro from src/doc/qt3d.qdocconf Task-number: QTBUG-74752 Change-Id: I71b9e85ff09c002fb283824aa51a5a8f50e937f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * | Merge branch '5.12' into 5.13Paul Lemire2019-04-0211-234/+379
| |\| | | | | | | | | | Change-Id: If17511da64dd666a536408aa3cb3178ef6db0403
| | * Don't reset texture units at every frameMike Krus2019-03-185-189/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resetting texture to unit assignment at every frame seems to trigger constant shader recompilation on macOS. Maybe GL driver is implemented on top of Metal which has more restrictions. Not resetting the assignment means the same texture units are used for consecutive frames and fixes excessive recompilation. Refactored the code to move the texture handling to separate class. Change-Id: I480f76e7e7b0ea669c6acb039cc3d079937ff97f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Fix member overloadsMike Krus2019-03-144-26/+10
| | | | | | | | | | | | | | | | | | | | | | | | m_currentVAO and m_glHelper were hiding members in parent class. Removed overloads and cleaned up initialization. Change-Id: I174dffc63c812e0b4241018c86e560de48a31a0b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Set OptimalParallelJobCount to at most 4Paul Lemire2019-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Profiling reveals that on fast cpus, having more jobs is counter productive. Set it to at most 4 as it seems to be a good all around values while waiting to fine tune it later on based on platform and hardware. Change-Id: I95033e34f10d7f37dfafe0b21c6724466eb78fae Reviewed-by: Mike Krus <mike.krus@kdab.com>
| | * renderview.cpp: move file variable into anonymous namespacePaul Lemire2019-02-191-1/+2
| | | | | | | | | | | | | | | Change-Id: I06cd85c76e513364abe754da51abac07dfd99821 Reviewed-by: Mike Krus <mike.krus@kdab.com>
| | * Fix: rebuild material and layer caches when FrameGraph tree is dirtyPaul Lemire2019-02-192-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This could otherwise result in black screens when the FrameGraph tree is updated and no other change is sent. Screen would remain black until some other element with dirty changes triggers a cache rebuild. Change-Id: Iac43965f06d1d644de14e6a6c8768e035bed69a6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | | Make it possible to partially update a texturePaul Lemire2019-03-203-75/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce QTextureDataUpdate which contains information about the update - QAbstractTexture::updateTexture function added - Add manual test texture-updates-cpp - Add unit tests for GLTexture and complete other texture tests Change-Id: I1b792f2075830ce05cc8e04cc68110141b5571d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | QSortPolicy: add sorting by TexturePaul Lemire2019-03-062-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be more efficient to render a scene by sorting drawing commands based on the textures they are requiring. In conjunction with Material sorting, this can reduce the amount of GL calls being sent to the driver. [ChangeLog][Qt3DRender] QSortPolicy can now sort by Texture Change-Id: Ibc013e9d506ea3061b19a56c548e8184f2b981cc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | | Rework internal Texture HandlingPaul Lemire2019-03-045-198/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove internal GLTexture sharing - Remove dataFunctor data sharing - Simplify the overall texture process: 1) Look for dirty textures (either a property on QTexture or a referenced QTextureImage has changed) 2) Update GL Resources - Create a GLTexture for a given Texture if it doesn't exist - Update GLTexture to reflect Texture state - Perform actual GL texture creation and or upload (call functors at this point) - Cleanup GLTextures when matching Texture node has been destroyed This will provide an easier maintenance over time as it drastically simplifies the handling of textures and removes most of the coupling. Furthermore this will make it possible to send texture updates on a QTexture node to update texture content without having to declare QTextureImages which would not have been (or would have been a lot harder) to do. In practice, I doubt most people were even aware of the internal texture sharing in the first place. [ChangeLog][Qt3DRender] Textures: internal data sharing removed Change-Id: I02867c8105e29eb1e193884e3899062f795f32f4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Add QNoPicking FrameGraph nodePaul Lemire2019-02-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows to disable execution of picking computations for a specific FrameGraph branch. [ChangeLog][Qt3DRender] QNoPicking: control picking execution in the FrameGraph Change-Id: I5e82eeee9d04d48cfc39a6126d30d36eab61ea77 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | | Cache light/renderable/computable vectorsJames Turner2019-02-204-37/+197
| | | | | | | | | | | | | | | | | | | | | | | | This avoids running these jobs when lights / renderables have not changed in a frame Change-Id: I604180fe3442ab67648c4ba5d9effb8639c68ef7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Add QRasterMode render stateJuan Jose Casafranca2019-02-1214-1/+54
| | | | | | | | | | | | | | | | | | | | | QRasterMode allows a user to change the raster mode from fill to lines or points Change-Id: If96848e38ac4b5a615040b3bae2dec38a03cb031 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-121-1/+1
|\| | | | | | | | | | | Change-Id: I99b5e3fd377f620dbb2fcf4dc14c2e5301baadb0
| * | Fix order of initialization in constructor listThiago Macieira2019-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | gltexture_p.h:263:9: warning: ‘Qt3DRender::Render::GLTexture::m_sharedTextureId’ will be initialized after [-Wreorder] gltexture_p.h:256:24: warning: ‘Qt3DRender::QTextureGenerator* Qt3DRender::Render::GLTexture::m_pendingDataFunctor’ [-Wreorder] gltexture.cpp:72:1: warning: when initialized here [-Wreorder] Change-Id: Id061f35c088044b69a15fffd15818f67b2e4d0d1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Add support for glDepthRangeJim Albamont2019-02-1114-0/+51
|/ / | | | | | | | | | | | | | | Added a new QRenderState to provide access to glDepthRange. Task-number: QTBUG-73059 Change-Id: I434b73e6e499307bfa58b2a1001e4c48328e9d5b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devMike Krus2019-01-234-12/+162
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/render/renderers/opengl/textures/gltexture.cpp Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I2b419458913a2e3cb2064b934b07b1f6ff05e3cd
| * Avoid repeated warningsMike Krus2019-01-183-4/+153
| | | | | | | | | | | | | | | | | | ES2 helper will sometimes flood with warnings. Same with textures that take several frames to load. Just make sure message appear again if functor changes. Change-Id: Id5d8a8a3fa1ab88b2b40d4f71bf91c26724654a2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix issue with invalid texturesMike Krus2019-01-181-8/+9
| | | | | | | | | | | | | | Previous fix for missing env map triggers some corner cases Change-Id: Icfa5657973b4050fed0681bb929091e7659012fc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-102-1/+9
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ie8a4bf768bffba61dca9e315151c035be7b48723
| * Fix env-map less renderingMike Krus2019-01-091-0/+7
| | | | | | | | | | | | | | | | | | Assign texture units to env map samplers even if they are not used. Remove previous work around from pbr material. Change-Id: I5060bfb61c4658339d2b74df71574c39cddfeb18 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Recompute bounding volumes when buffer changesPaul Lemire2019-01-071-1/+2
| | | | | | | | | | | | | | | | | | | | Right now the bounding volumes would be computed only when a geometry is marked dirty, which essentially means only when the geometry is first loaded. However, if a geometry buffer were to change, we need to recompute the bounding volume. Change-Id: Ie3fb83d1cc11a3bbfbe2b9828e9f8d7c302d175b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-112-8/+10
|\| | | | | | | | | | | | | Conflicts: src/render/renderers/opengl/textures/gltexture.cpp Change-Id: I57e9a296dc15f0b5dc3af3664f698bdc799c4bb5
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-12-041-3/+3
| |\ | | | | | | | | | Change-Id: I9f4dd807f0179d7bd95a5263e57c37198e7432f4
| | * Renderer: drawArraysInstancedBaseInstance parameters were swappedPaul Lemire2018-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | FirstVertex and FirstInstance parameters were swapped making any draw call that requires baseInstance or baseVertex unusable. Change-Id: Icf52f96981d8868bec4c6888bd129ed6e43d39e9 Task-number: QTBUG-71994 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-11-082-5/+7
| |\| | | | | | | | | | Change-Id: Ia208586ec402c9ce29bafc9085804d8b1a62b155
| | * Renderer::doRender scene3dBlocking fixesPaul Lemire2018-11-051-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Reorder sleep and locks -Properly protect isFrameQueueComplete lookup -Reread queueIsEmpty which could have been updated Change-Id: I2b5a52284bbb3ddb48483c5bf73779e335c8bdda Task-number: QTBUG-71294 Reviewed-by: Christian Andersen <csandersen3@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * GLTexture: do not set layers when target is Texture3DPaul Lemire2018-11-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Because Texture3D doesn't support layers and that results in a warning being added to the console. Change-Id: I54d34ccccc2bc1f022814689b97aaaf624026249 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | QComputeCommand allow to control the run behaviorPaul Lemire2018-11-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | It can either be Continuous, like it was until now or Manual. When in manual mode, the compute shader will only be executed by calling trigger() Change-Id: Icaae24f4691ccd821297f967d564e7a883fa60b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-033-3/+12
|\| | | | | | | | | | | Change-Id: I95431b48ee9828be602c088cdd798fabbd1723ef
| * | Merge remote-tracking branch 'origin/5.11' into 5.12.0v5.12.0-beta4Liang Qi2018-10-301-0/+3
| |\| | | | | | | | | | Change-Id: I5499524c9f4553342d192d554d4455fd7933eaa9
| | * Fix crash due to racecondition in renderer on shutdownChristian Andersen2018-10-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protects access to m_renderQueue using the m_renderQueue mutex on shutdown. When a Qt3DWindow is deleted it signals the aspect thread to do early cleanup, the aspect thread calls Renderer::shutdown which in turn resets m_renderQueue. Meanwhile the render thread may be working on m_renderQueue, this leads to a double free of the front render view in m_renderQueue (and potentially other stuff). Fixes: QTBUG-69877 Change-Id: Ifd018597dbdb2f1538494932c907c63e8db9c715 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * | Don't trigger Q_UNREACHABLE if passed invalid render buffer formatsChristian Andersen2018-10-222-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds warning printout of the format that triggered the error. The graphics card may produce a proper image, but readFrameBuffer doesn't know how to interpret it. Additionally adds printout of the format when the code doesn't know the equivalent OpenGL ES 2.0 format. Fixes: QTBUG-66515 Change-Id: I65559f7d397a9297521ae0b1ebaf120629be3873 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Implement WaitFence/SetFence handling into the rendererPaul Lemire2018-10-1221-13/+500
| | | | | | | | | | | | | | | | | | | | | | | | Slightly reorganize jobs between jobs needed for rendering and jobs that should run even when no rendering is required. Change-Id: I02d262efd8cb46c71c40ac6dbcd4d1b25bb725e1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Texture: update renderer to send handle and handle type on frontend texturesPaul Lemire2018-10-112-4/+9
| | | | | | | | | | | | | | | | | | Change-Id: I78047f354a9f7cdbb56bd2b5dee79cb77e6cb749 Task-number: QTBUG-70055 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Merge "Merge branch '5.12' into dev" into refs/staging/devSean Harmer2018-10-118-1/+35
|\| |
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-058-1/+35
| |\| | | | | | | | | | Change-Id: I2a92242b0d6be4f4e7f07f0f020fa6751ada9bc3
| | * Further complete missing functions on ES3 helpersPaul Lemire2018-10-044-0/+23
| | | | | | | | | | | | | | | | | | Change-Id: I62e83c360619a2e096401330a61a6f2602b743d2 Task-number: QTBUG-70660 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>