summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem/shader_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Add yUpInNDC and yUpInFBO uniformsPaul Lemire2020-08-131-0/+2
| | | | | | | | | | | | This is useful when using RHI as depending on the backend these might have different values and gives a chance to shaders to account for that. Also added to the OpenGL renderer for consistency [ChangeLog] Add yUpInNDC and yUpInFBO default uniforms Change-Id: I76b07906cb2c8e1acb9683428773e27985677df4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVector in renderJarek Kobus2020-07-091-1/+0
| | | | | | | | | 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>
* GraphicsHelpers/GLShader: switch to std::vectorPaul Lemire2020-07-031-2/+2
| | | | | Change-Id: I8be6695e0c52dfbe353cd381d94548aba1c7da82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add missing overrideAlexander Volkov2020-05-251-1/+1
| | | | | Change-Id: I6a2a4577b4c45d7ac601d2693044c3817e245111 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-04-271-0/+1
|\ | | | | | | Change-Id: Id669d5c1aab29965eac0dabd1cb497e908dac23e
| * Initial creation of RHI plug-in and refactoringJean-Michaƫl Celerier2020-03-161-0/+1
| | | | | | | | | | Change-Id: Ifbb51003e15f798798040597b5f7224641e8147c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 5.15 into devMike Krus2020-02-171-1/+1
|\| | | | | | | Change-Id: I2777f6a40b9029ef5569a84e04f9e18a914504e7
| * Shader fixesPaul Lemire2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Make sure that shaders marked for destruction are un marked from destruction if recreated before having been destroyed. - When loading shaders, make sure the shader wasn't already loaded when loading it. This can happen is a shader is abandoned and then re adopted. Change-Id: I04597479d782bc6d31e4c7f78425c02c31217c7e Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Remove deprecated classes and functionsPaul Lemire2020-02-111-2/+1
|/ | | | | | | Mostly old messaging API Change-Id: I17eb2206b2ede56d2f7d36375d5e711d6149019f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move classes in OpenGL renderer plugin into an OpenGL namespacePaul Lemire2020-02-051-6/+8
| | | | | Change-Id: I5314da1df7fbfd1b6db4412e7bc71231525d9de2 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make the OpenGL renderer a pluginPaul Lemire2020-02-051-1/+1
| | | | | | | | By default the QRenderAspect will try to load this plugin Change-Id: Ie55e207fb8e6d0b64f717bbb99699eb669eaa3f2 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderProgram: add a format propertyPaul Lemire2020-02-031-0/+4
| | | | | | | | | Can be either GLSL (default) or SPIRV at the moment. This variable will be used by the rendering backend to know what type of shader code was provided (e.g with Vulkan, the GLSL could be internally converted to SPIRV) Change-Id: I1f9b734a675c581ef0721edc4464e466a18afbb0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Introduce a GLShader classPaul Lemire2020-02-031-77/+19
| | | | | | | | | | | | | | | | GLShader is renderer specific shader implementation for OpenGL. Shader now contains only backend information for a QShaderProgram frontend node. - Similar to the GLTexture handling, a generic adopt/abandon manager for shaders was introduced (regardless of the actually GraphicsAPIShader class). - The renderer and renderviews were adapted to the new changes. This was the last major thing preventing the modularisation of the QRenderAspect and renderers Change-Id: If671d60928b433977e9d6e5c58199827f9408a3f Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-071-0/+26
|\ | | | | | | Change-Id: I6682d27cc7c4f54158fa6813b1de6edce77bea33
| * Shader: record standard uniform at loading timePaul Lemire2019-12-041-0/+26
| | | | | | | | | | | | | | | | Avoids having to check for each uniform (for each frame, each geometry) whether it is a standard uniform or a user defined one. Change-Id: I76cff7869aacc1343a9acf991f8035b8118581ed Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix usages of text stream operatorsAlexandru Croitor2019-12-061-1/+1
|/ | | | | | Change-Id: I8f3fe9475749f10f33c8eb750befa8845ccc37d6 (cherry picked from commit 58db7d01e0d424fdf46baa70e2e41b8009429c78) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Convert Shader/ShaderBuilder jobs to use direct syncPaul Lemire2019-10-141-4/+3
| | | | | Change-Id: Ia56ba6176c86e34904611ae57e682ac9d52c79f7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update QShaderProgram to use direct syncPaul Lemire2019-09-261-3/+1
| | | | | Change-Id: I71cac1345ed7b9e14b8cdc479c60f0384bb0b198 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Replace Q_DECL_FINAL with finalKevin Funk2017-09-251-1/+1
| | | | | Change-Id: Ia80d1cb9cc96d76f8b367caa725c59a70ae0a4d5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-1/+1
| | | | | Change-Id: I92c955068e233c50043ad7d06a32300dd386c24d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shader: factor out the logic to change shader codeKevin Ottens2017-07-051-0/+1
| | | | | Change-Id: Iabf8371534aededb4c45a0be0a3e1a1846ecc9ef Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QShaderProgram: rename enum ShaderStatus to StatusPaul Lemire2017-02-161-3/+3
| | | | | | Task-number: QTBUG-58896 Change-Id: I39be12a9fe00d3fd2e2f6074dd7f8df728ac1b7a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ShaderProgram: store and send log and status to frontendPaul Lemire2017-01-251-2/+14
| | | | | | Change-Id: I00b02f8b73ecf1194b4c4db7b60a95ee7cc3df22 Task-number: QTBUG-57615 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shader sharing: perform introspection once per shared shaderPaul Lemire2017-01-251-1/+1
| | | | | Change-Id: If726f3031cbd6311acdb13adb8abb191c362f386 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make sure destroyed OpenGL context is no longer usedv5.8.0-rc1Miikka Heikkinen2016-12-161-0/+1
| | | | | | | | | | | | Listen to QOpenGLContext::aboutToBeDestroyed() signal in classes that do cleanup related to OpenGL context to disallow its use after its destruction. Task-number: QTBUG-57578 Change-Id: I580e737da7b0c9167dc3cfd65514f2b3f689bb62 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Fredrik Orderud <forderud@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed files quniformvalue* to shaderparameterpackPaul Lemire2016-09-161-1/+1
| | | | | | | | | These files contains a class named ShaderParameterPack so filenames needed to be adjusted. Change-Id: I8735c753e2a741a6238780b40fb42143d4439e09 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renderer: make submission not rely on the Shader backend nodePaul Lemire2016-07-051-1/+1
| | | | | | | | | | | | | | | Instead use the stored shaderDNA in the command. Make GraphicsContext able to activate a shader based only on the DNA. This also forced to store the uniform values slightly differently so that they can be applied without requiring a backend Shader node at submission time. Interestingly according to the Qt3DProfilter the load has shifted from the second submission part to the first one because of this. The nice things is that the load of the first part could be spread across multiple threads. Change-Id: I7c543766d3c088ab3886ca1cd3b529f8deb18a93 Task-number: QTBUG-54423 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix shader cachingSean Harmer2016-06-011-8/+7
| | | | | | | | | | | | | | | | | | | | | Introduces a specialized ShaderCache class. This is populated with shaders on demand from render command processing. Likewise for adding references to shared QOpenGLShaderPrograms from other Shader backend nodes. When a Shader backend node is destroyed, it will remove its reference from the ShaderCache. When a shared QOpenGLShaderProgram has no remaining references the cache marks it as pending deletion. If it still has no references the next time the OpenGL submission thread calls the purge() function on the cache, it will be removed. With this approach the actual QOpenGLShaderProgram objects are managed purely by the OpenGL submission thread and are owned by the cache once added to it. Task-number: QTBUG-53669 Change-Id: Ia8459b0fdb775148c83202a801ac41cbdd447bcc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Replace Q_DECL_NOEXCEPT by Q_DECL_NOTHROWPaul Lemire2016-05-231-10/+10
| | | | | | Change-Id: Ia991da557483704055e0ccf17b4a6b273568a1ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix dynamic shader code updatesSean Harmer2016-05-221-0/+1
| | | | | | | | | Being careful to remove cached pointer to the shader program from the graphics context. Task-number: QTBUG-53527 Change-Id: Icee8aaa3f0900c7aa42598ad81b3f368f0338f46 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove QBackendNode::updateFromPeer()Sean Harmer2016-05-031-1/+0
| | | | | | | | | | Implemented a few missing initializeFromPeer() implementations along with the corresponding frontend node creation change creation functions. Adapted unit tests. Change-Id: I571e53a7b68a5544bd0e308df0baf7e52533306e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove shader from cache in graphics context cache when deletedSean Harmer2016-04-171-0/+1
| | | | | | | Stops assert firing when trying to use a recycled Shader Change-Id: Ifa18143a145654fd3f9e381627406e907a9e2d48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add debug operator for Shader backend nodeSean Harmer2016-04-151-0/+9
| | | | | Change-Id: Ie3853ebd8370a76e3389c31f716d399ab48b615a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Shader handles creationSean Harmer2016-04-101-0/+2
| | | | | Change-Id: I0705d14a4d7c5a9ce6df5274ff8e59414f55e695 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove ParameterMappingPaul Lemire2016-02-261-0/+2
| | | | | | | | | | | | | | * Bindings are now entirely deduced from shader introspection * Modified the BackendNodeDirtyFlags to remove the class at this prevents the operator~() to be called * Make the Renderer loop check for the ComputeDirty flag and don't unset it if set Note: uses a hack to reset m_changeSet in performCompute as right know we are sometimes missing the markDirty(ComputeDirty) set by the ComputeJob nodes. Will be sorted out later. Change-Id: Ic4fa71ecf01b625e885a58a66278387bf5b36339 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Dedicated QRenderBackendNodeWieland Hagen2016-02-241-4/+4
| | | | | | | | | Render aspect Backend nodes now subclass from QRenderBackendNode, which is a subclass of QBackendNode. We may want to store aspect- related data in each backend node Change-Id: I4f00de09c8cc31d2347d919151d359ad44cf03a9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shader: make noexcept and inline simple gettersPaul Lemire2016-02-221-9/+9
| | | | | Change-Id: Ie2c39d69008be3dfc9ace28d3b95e9e640d3fc65 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderViews: use int comparison rather than string for uniforms filteringPaul Lemire2016-02-211-4/+14
| | | | | | | Provides a non negligible gain in performance. Change-Id: I1165d1fcd044e3bdebf286539da2f5316f764540 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/doc/src/qt3dcollision-module.qdoc src/render/frontend/qcamera.cpp src/render/frontend/qcameralens.cpp Change-Id: I8a0ae250a6b8e065a1ef3c817968ebb7ef23b20d
| * Don't allocate QMutex members on the heap.Volker Krause2016-01-191-2/+2
| | | | | | | | | | Change-Id: I23f1ccd2f2bbee2fcab2eadfeeec83e1ac489623 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Unify license header usageAntti Kokko2016-01-261-11/+14
| | | | | | | | | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I8eac0cd6bbc276a56df487249cc459c0d4fab165 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | Rename QUniformPack to ShaderParameterPackPaul Lemire2016-01-131-1/+1
| | | | | | | | | | | | | | | | This will make it more clear that it also contains other things like UBO/SSBO which are pure Uniform values. Change-Id: I641246798b8c868d7bfdfde381221d9a97ed2d35 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Shaders: retrieve SSBO blockPaul Lemire2016-01-131-2/+11
|/ | | | | Change-Id: I62065d30b197367c8e5e03099c3af034892c4038 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename Renderer -> Render throughoutSean Harmer2015-10-191-2/+2
| | | | | | | | This is for consistency between the C++ namespaces and QML imports and with the other aspects. Change-Id: I73392f138b4e519b12888f52530123e3d0ba445e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-3/+3
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add "We mean it" warnings to private headersSean Harmer2015-10-131-0/+11
| | | | | Change-Id: Ic4a69123255c33990765ea3601e01914c2d8cb70 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move material system into own directorySean Harmer2015-10-131-0/+132
Change-Id: Iddc3a5d41dc0aff858d8bc3c5b2f7982bd693d00 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>