summaryrefslogtreecommitdiffstats
path: root/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Destroy FBOs when RenderTarget node is destroyedPaul Lemire2020-02-131-0/+8
| | | | | | | | It appears we never destroyed FBOs which lead to bugs when destroying and recreating a RenderTarget Change-Id: I99b3df95b821670aa3bbd63209ff9bcc21afbf79 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* PackUniformHash to QVectorPaul Lemire2019-11-141-3/+3
| | | | | | | | | | | | | | | | | | | Surprisingly it's hard to notice its effect in the speed of execution, frame preparation looks to be more or less the same with the profiler. However with vtune, the profiling traces show a huge difference with QHash, mainly in time spent allocating memory. It shows a noticeable reduction in CPU usage. On bigscene-cpp with 600 entities QHash -> On a 158s run, CPU time is 112s (70%) free accounts for 26s (23%), malloc 24s (21%) QVector -> On a 190s run, CPU time is 110s (58%) free accounts for 5s (4.5%), malloc 4.7s (4.2%) Change-Id: I880d44b1acf7f051e479ed356864c3caf407f23f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix crash in Scene3DViewMike Krus2019-10-251-8/+8
| | | | | | | Also fix warnings in SubmissionContext Change-Id: I7c8fe353547c6819d7a0a64f4bf49ea0b005f7dc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix Coverity warningsMike Krus2019-10-211-3/+3
| | | | | Change-Id: I00c875b48d838170fddf0b92f0ac5592828c6f0f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix blitting to also blit depth and stencil buffersPaul Lemire2019-10-101-1/+2
| | | | | Change-Id: Ib7b491c638508cfcdfbd523fd4e6a3d757c2c832 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge remote-tracking branch 'origin/5.13' into devPaul Lemire2019-08-201-1/+1
|\ | | | | | | Change-Id: I53aa6c3f61b1f624ec553079a9332c96486abf3f
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-131-1/+1
| |\ | | | | | | | | | Change-Id: I359b15d87622515ee4f05db1f01d4b476027378e
| | * submissioncontext fix: devicePixelRatio is not an integerPaul Lemire2019-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Converting it to int would cause the viewport not to take the whole expected size as the interger conversion would essentially floor the value. Change-Id: Ic608b0e1a0910aadb8b98c3225f999cba6326535 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | | Renderer: Image support addedPaul Lemire2019-06-051-4/+39
| | | | | | | | | | | | | | | Change-Id: I5b2764f0ae5184c2097d6da5e7a6e24b5c6a5d1b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge remote-tracking branch origin/5.13 into devPaul Lemire2019-04-151-189/+16
|\| | | | | | | | | | | Change-Id: Ib5c04e9941aeea1a4cd27519b94b9a53e8349ea3
| * | Merge branch '5.12' into 5.13Paul Lemire2019-04-021-189/+16
| |\| | | | | | | | | | Change-Id: If17511da64dd666a536408aa3cb3178ef6db0403
| | * Don't reset texture units at every frameMike Krus2019-03-181-157/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Add QRasterMode render stateJuan Jose Casafranca2019-02-121-1/+15
| | | | | | | | | | | | | | | | | | | | | 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>
* | | Add support for glDepthRangeJim Albamont2019-02-111-0/+14
|/ / | | | | | | | | | | | | | | 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-231-8/+9
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/render/renderers/opengl/textures/gltexture.cpp Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I2b419458913a2e3cb2064b934b07b1f6ff05e3cd
| * 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 Bot2018-11-031-2/+5
|\| | | | | | | Change-Id: I95431b48ee9828be602c088cdd798fabbd1723ef
| * Don't trigger Q_UNREACHABLE if passed invalid render buffer formatsChristian Andersen2018-10-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | 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-121-0/+27
| | | | | | | | | | | | | | | | 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>
* | Renderer: implement using OpenGL textures from a texture idPaul Lemire2018-10-111-4/+16
|/ | | | | | Change-Id: Ifc65966c50cb6fc8780206852f92bf1d4a6b4d5b Task-number: QTBUG-69918 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Complete ES 3.1 and 3.2 helpersPaul Lemire2018-09-211-3/+7
| | | | | | | | | | | Which didn't handle indirect drawing, compute and tessellation Since ES 3.1/3.2 don't provide API for glShaderStorageBlockBinding, code was adjusted to use the default binding points and not require that API. Change-Id: Ie4dcd05f0a1d72e4a25f49b5fae138dc605ba5e3 Task-number: QTBUG-70660 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid initializing GraphicsContext on every frameLaszlo Agocs2018-08-141-3/+1
| | | | | | | | | m_initialized is inherited from GraphicsContext, having another m_initialized in SubmissionContext is wrong. Change-Id: I431ba67c671b8854fafce769c8bfd90ba71e7441 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Properly update properties from Backend to Frontend texturesPaul Lemire2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | Taking into account we have texture sharing in the backend, we can only update frontend texture properties once we have created the shared backend texture. Code was adjusted to retrieve these properties when creating the GLTexture. Such changes are stored and sent on the next run loop from a job where they are distributed to all referenced frontend Texture. The status property handling has also been updated to send status changes to all shared textures instead of just the texture whose data generator is used to gather the data. A manual test checking texture property updates, sharing and remote url sharing has also been added. Change-Id: I8ed2449fe57c9d7337580b0f7561f974cbd5006d Task-number: QTBUG-65775 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't abort rendering when env light textures are not setPaul Lemire2018-06-271-2/+10
| | | | | | | | | | | | | | | | | | The MetalRoughMaterial provides parameters for the env light textures even though they are optional but are needed to avoid issues with unbound textures on some drivers. In practice, when an env light is present, the values would be overridden. However if no env light is present, when setting the texture values on the shader, they would actually reference invalid textures and Qt3D would not render. We want to keep the behavior for the general case but make an exception for MetalRoughMaterial, therefore we are checking if the missing textures are the ones for env light or not before aborting. Ideally, we should shortly be able to remove the QParameters altogether with the Shader Builder. Change-Id: Id54436ff9e328c390eacceb3e63809c757b28b2a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Fix BlitFramebuffer on GLESLaszlo Agocs2018-05-291-2/+10
| | | | | | Task-number: QTBUG-68395 Change-Id: I216f32bd22d12c6fa6f2efd09765ad95754326b4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix flashing and crashing of scene2dMäättä Antti2018-05-291-0/+42
| | | | | | | | | Prevent simultanious usage of the GLTexture being rendered to by scene2d. Task-number: QTBUG-68511 Task-number: QT3DS-1792 Change-Id: I88de12cba68ef7af2c7afb1f6e9d6143028efc86 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Merge remote-tracking branch 'origin/5.11.0' into 5.11Qt Forward Merge Bot2018-05-091-1/+2
|\ | | | | | | Change-Id: I666d4ca1ad39f81e41a9b47a8828d1689ff2b33e
| * Remove race in texture data uploadPaul Lemire2018-05-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In the non locked submission phase of the renderer, the GLTextures must have had their content/properties already updated as this is too late to actually create or upload texture based on references which may be invalid or outdated. This wasn't properly handled. We now perfom the GLTexture creation and data upload when both the RenderThread and AspectThread are locked. Task-number: QTBUG-67989 Change-Id: I07ac23120e8d37a86e60d2b892d1437b8cb0b3dc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix compile warningsMike Krus2018-04-201-0/+2
|/ | | | | Change-Id: I4aceeeb455aedc3c84e3a17983a894f1f84bdc09 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix compilation with QT3D_RENDER_ASPECT_OPENGL_DEBUG defineAndy Nichols2018-04-121-1/+1
| | | | | Change-Id: If89cc9d4be85ad36dfd7549e58327d8a525210e9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* SubmissionContext: improve specifyAttributePaul Lemire2018-03-201-8/+9
| | | | | | | By reusing existing VAOVertexAttribute instance Change-Id: I78554a5849f76a01e901371e4dcb363779906f86 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderStates: rework to split node and rendering partPaul Lemire2018-03-191-1/+381
| | | | | | | | | | 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>
* Move Renderer specific classes into new folderPaul Lemire2018-03-191-0/+1211
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>