summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Fix render to texturePaul Lemire6 days4-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL helpers have a drawBuffer and drawBuffers functions. drawBuffer takes in a GLenum (GL_COLOR_ATTACHMENT0 + n) and drawBuffers took in QRenderTargetOutput::AttachmentPoint (0 - 15). When changes were made to support stereo rendering (QTBUG-123483) we endup in a case where if we have a single color attachment we would end up calling drawBuffer and if we have multiple attachments drawBuffers. In both cases though, we end up calling with AttachmentPoint values instead of GLEnum which broken render to texture since drawBuffer(0) is not the same as drawBuffer(GL_COLOR_ATTACHMENT0 + 0). The first actually disables the color attachment. To solve this and reduce confusion, drawBuffer and drawBuffers now both take GLEnum values. In the AttachmentPack we only store AttachmentPoint values (since AttachmentPack is Graphics API agnostic) and we take care of converting the AttachmentPoint values to GLenum values when calling drawBuffer or drawBuffers. Also remove duplicate activateDrawBuffers function in GraphicsContext as we only need the one in SubmissionContext Pick-to: 6.7.2 6.7 6.8 Task-number: QTBUG-126251 Change-Id: I00966c07902699450854d3d8327422967872a985 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Correct license for test filesLucie Gérard2024-04-2316-16/+16
| | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I966d4033a73aacabb39f582270f2f1c18e2bcecd Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Fix deprecation warningsMike Krus2024-01-151-2/+2
| | | | | Change-Id: I62b13867eb0b5a0aff974b34df714bfeba776d4b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Disable the graphicshelpergl tests on AndroidVille Voutilainen2023-05-091-1/+3
| | | | | | | | | | They don't build on NDK 25, if anywhere, since Android uses GLES or Vulkan. Change-Id: I64a207a3543aa2274c28617241f9e278dd7b9aa2 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove qmake build filesMike Krus2023-03-1718-280/+0
| | | | | | | | Except in examples Pick-to: 6.5 Change-Id: I31b06ddfc79f14dde3369518a76d57606daf939f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove Qt6 QT_VERSION checks from the code basePaul Lemire2023-02-104-29/+0
| | | | | | | | | | Those are left overs from the Qt 5.15 to Qt 6 port. Now that both code based have diverged, there's no much point in keeping those checks. Pick-to: 6.5 Change-Id: I4e83876b6b4cb18b181af32e376f4411054a1183 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* tst_renderviews: fix signed/unsigned mismatchMarc Mutz2022-12-151-4/+4
| | | | | | | | Amends f672753556cf28d44f864457dc6338a55e2e0ed4. Pick-to: 6.5 6.4 6.2 Change-Id: I5c3e99a033cead91a03ab468b4c44b687422baac Reviewed-by: Mike Krus <mike.krus@kdab.com>
* tst_filtercompatibletechniquejob: fix signed/unsigned mismatchMarc Mutz2022-12-151-1/+1
| | | | | | | | Amends 914752257634dede18cc5079f2a506b699744058. Pick-to: 6.5 6.4 6.2 Change-Id: I0320fb3b5e44e10e6ee106bbcb79322323cc3d12 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* ShaderParameterPack: check we only store a single UBO/SSBO per BlockBindingPaul Lemire2022-11-021-0/+62
| | | | | | | | | | | | | Since we cache ShaderParameterPacks over multiple frames, we need to ensure that we check that when setting a UBO/SSBO we don't already have an entry matching the block index. If that's the case we should simply replace the entry rather than append a new entry. Failing to do so results in appending a growing number of UBO entries for the same block. Pick-to: 6.4 6.2 5.15 Change-Id: Ie7535a80b9426ce2fd5ab6ebe16ea71bd7447750 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I3b040fa72968753048fd669c073ae80c3ba1bdad Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2417-17/+17
| | | | | | | Task-number: QTBUG-105718 Change-Id: I97fa27f60a8546ea3d73cc7daf1b728c615a1ab0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tests: fix a bunch of -Wsign-compareMarc Mutz2022-07-1211-78/+80
| | | | | | Pick-to: 6.4 6.3 Change-Id: I603612ecd55c8ac92fc28152a3cc0e192b8b67f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add license headers to cmake filesLucie Gérard2022-07-0817-0/+51
| | | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I141f5077ae0c11e1058de64d573ca33e2a308ccd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-2216-432/+32
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I8105424281eed871037fa6c463871ca8829876b5 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix tests that have to run with opengl backendPaul Lemire2021-07-292-0/+10
| | | | | | Pick-to: 6.2 6.1 Change-Id: Ia7e3b84667d78f45195702fc131f0d3d88d1c7e7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Minor fixes to compile against 5.15Paul Lemire2021-02-011-0/+11
| | | | | Change-Id: Id9574cf23b9af29815d8452915cebfc380fd94d1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Restore use of QVector in private APIMike Krus2021-01-052-4/+4
| | | | | | | | Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix binding of CubeMapArray texturesJim Albamont2020-12-111-0/+107
| | | | | | | | | | | | | | To bind to a specific face: use glFramebufferTextureLayer and calculate the layer as 6 * layer + face. To bind to a specific cubemap: There is no way in OpenGL to directly bind to an entire cubemap within the array. Instead bind to the entire texture as for a CubeMap with AllFaces. It is up to the drawing code to select the right cubemap and face, 6 * layer + face Change-Id: Ib9e1a598503eeba1fa729677944aba6d799f90b2 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Don't include the world for testsMike Krus2020-12-093-3/+3
| | | | | | Pick-to: 6.0 Change-Id: Ib87186571dbf911004d8292e0c0cd9ddaea92318 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix deadlock when running with QT3D_MAX_THREAD_COUNT=1Paul Lemire2020-12-012-4/+4
| | | | | | | | | Also remove duplication and make QAspectJobManager::idealThreadCount the centralized function to retrieve expect maximum number of threads. Pick-to: 6.0 6.0.0 Change-Id: Iec8d65d368ac7825ef87e883a987551726603adc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Handle changes in OpenGL classesMike Krus2020-11-273-2/+20
| | | | | | | Support building against both 5.15 and 6 Change-Id: I46e15f2f898f5f2304075e290798d3d2aea47dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix deprecated API usage and compile warningsMike Krus2020-11-203-9/+6
| | | | | | | | | - QVariant::Type deprecated, use QMetaType related APIs - QNodeId not used as reference in for loops (nop but really noisy) - some unused code Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix GLTexture cleanupPaul Lemire2020-11-045-1/+163
| | | | | | | | | | The GLTexture class wasn't registered for cleanup on the manager. This could result in it being reuse while not being reinitialized resulting in incorrect rendering. Change-Id: I85e6a5c3b5ca9d3cfa5ac5bcb1db3695dabfa576 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use internal CMake APIMike Krus2020-10-0715-31/+31
| | | | | | Task-number: QTBUG-86815 Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move sync jobs to a common place so that they can be used by rhi and openglPaul Lemire2020-08-261-1/+2
| | | | | | | | | This reduces duplication and will make it easier in the long run to maintain both backends since what these jobs are doing are doesn't really on the rendering backend in use. Change-Id: I9e51f964880874de52a2fa55c7753a1a5633d023 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix missing override warningPaul Lemire2020-08-134-8/+8
| | | | | Change-Id: I568ba2d39179f9b5b35190cf86c316788f903d6c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVector in testsJarek Kobus2020-07-0910-77/+51
| | | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I48e643bd20e21bee031555af598ad95d9873de12 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-081-1/+1
| | | | | | | | | 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>
* Move and adapt RendererCache to share amongst renderer pluginsPaul Lemire2020-07-071-4/+4
| | | | | Change-Id: I4e6e48abdd79b59fe98a916c7f2da6ba92e8ff82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Refactor RenderQueue so that it can be shared between renderersPaul Lemire2020-07-072-10/+10
| | | | | | | 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-075-74/+75
| | | | | | | | | | - 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>
* RenderQueue: switch to std::vectorPaul Lemire2020-07-031-1/+1
| | | | | Change-Id: I49ab3985ee01e40950bcd981dc77139a28f8db6a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GraphicsHelpers/GLShader: switch to std::vectorPaul Lemire2020-07-036-33/+33
| | | | | Change-Id: I8be6695e0c52dfbe353cd381d94548aba1c7da82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* APIShaderManager: switch to std::vectorPaul Lemire2020-07-031-12/+16
| | | | | Change-Id: Ied22ef9dea4cd3043f9f3d5ec69d7628e60b7dd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-022-45/+53
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Renderer: move QVector to std::vector changesPaul Lemire2020-07-011-1/+1
| | | | | Change-Id: I99a55a52da55b9b8c32e0db8e47932a4eb2820fa Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Switch to std::vector in QRenderAspect backend and OpenGL rendererPaul Lemire2020-06-301-7/+13
| | | | | Change-Id: I91dd69fc205401b12f333a9a0534d9612c8e24f8 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove the OpenGL Render ThreadMike Krus2020-06-197-23/+23
| | | | | | | | | | | | | | | | | | | | 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>
* Update dependenciesPaul Lemire2020-06-122-50/+30
| | | | | | | | | | | - QOpenGLEXtensions now private API in GUI - Removed support for tessellation in GL 3 - Use QMouseEvent position - Removed use of QDesktopWidget - Adapt to change in QQuickWindow API Change-Id: I79df8780b9d02c6d2a3620529f5f41daec7120fe Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Disable gl renderer tests on stand alone testsMike Krus2020-06-111-18/+20
| | | | | Change-Id: Iea18efffcd2515852fe5014115ff79883d0e57c7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rework ShaderData/UniformBlockValueBuilder to minimize String lookupsPaul Lemire2020-06-081-63/+134
| | | | | | | | | | 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>
* Fix some more compile warningsPaul Lemire2020-06-041-1/+1
| | | | | Change-Id: I5c42d2be7d06388609c46f9becaf147f7ce8d6ae Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Leverage RV cache to reuse render commands when possiblePaul Lemire2020-05-251-64/+159
| | | | | | | | | | | | | | | | | | | | | | | | - Only perform render command filtering when needed (when camera has moved usually) - Keep RenderCommand around so that we only update them if needed: -> We keep a double set of commands we per RV and switch in between every frame - Introduce EntityRenderCommandDataView as a wrapper around RenderCommands -> Use std::vector for RenderCommand storage (avoids hidden detachments) -> Filter and sort indices into the RenderCommand vector rather than the commands directly - Cleanup RenderView -> Remove InnerData field -> Hide direct RenderCommand access - Next steps -> Only update uniforms that need to be updated -> Most likely lights/standard uniforms won't all change every frame -> Only update light sources for entity when needed Change-Id: I153822a16c0989a8ac5b83d756385056c96572aa Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add support for building with CMakeMike Krus2020-05-2219-7/+487
| | | | | Change-Id: If6c887c6356a160a5f3fb906d38a341fff0c7b29 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QResourcesManager: switch to std::vectorPaul Lemire2020-05-201-1/+1
| | | | | | | | | 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>
* Fix build for Qt6Mike Krus2020-05-066-10/+14
| | | | | | | | | | | | | - updated dependencies, excluding qtgamepad for now - fixed issues with Q_PROPERTY not supporting forward declarations - fixed for changes in QtQuick private API - fixed for changes in QtOpenGLVersionFunctions API - fixed for removal of QT_OPENGL_ES* macros - fixed for changes in QtConcurrent API - fixed RHI based build Change-Id: I42ccd2f101b7f0a78e2860c6d551722bf6710a11 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-04-273-10/+22
|\ | | | | | | Change-Id: Id669d5c1aab29965eac0dabd1cb497e908dac23e
| * Adjust number of jobs based on number of render pathsMike Krus2020-04-142-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Split examples so that build works without qtdeclarativeJean-Michaël Celerier2020-03-111-1/+4
| | | | | | | | | | Change-Id: I98507808b43b116b1950fd60df54704562a234ce Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-03-103-69/+31
|\| | | | | | | Change-Id: Ida354e9c302ef968fbae78edd60a1ad1fabef477