summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Make sample meshes geometry renderers againMike Krus2020-07-3030-152/+1950
| | | | | | | Introduce new geometry view class for each. Change-Id: I8e9a8f3a078d4cc63f9656ae8142e39f05d755c7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for synchronous pickingMike Krus2020-07-3016-145/+154
| | | | | | | | 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>
* rhi: Update PipelineUBOSet::resourceLayout to not allocate UBOsPaul Lemire2020-07-293-34/+10
| | | | | | | | | | | | This is possible since the merge of https://codereview.qt-project.org/c/qt/qtbase/+/307472 When we build pipelines, we only need to know about the layout of the resource, allocating UBO is only required when we want to use the pipeline for draw calls, later. Change-Id: If0ee9238fb13aea04d473c01a7bac3df2ffb02e0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: don't abort early when a geometry has more attributes than a shader ↵Paul Lemire2020-07-291-9/+6
| | | | | | | | | | requires It's a valid use case to have shaders with less attributes than what a geometry provides Change-Id: I718478996eb62ffab880e25492b47a3fde1ae9b3 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* EnvLight uniforms add name aliasesPaul Lemire2020-07-292-4/+20
| | | | | | | | | | | | | | Add alias envLightIrradiance for envLight.irradiance and envLightSpecular for envLight.specular. Uniform struct can contain samplers but UBOs cannot contain samplers. Depending on the target platform, having standalone uniform names to access the env light specular and irradiance maps are therefore required. Change-Id: I006bb45865175396a8b0c2bf9ed7e9cee94abf60 Pick-to: 5.15 Pick-to: 5.12 Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Refactor Scene3D to work with both RHI and GL Qt3D renderersPaul Lemire2020-07-2916-302/+706
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* Protect accesses to the Render cachePaul Lemire2020-07-271-1/+4
| | | | | | | | It seems Qt6 QHash implementation might rehash on lookups which leads to data races in case of concurrent lookups Change-Id: I9fff2c8303fdd5908acc27d6d98fc963876d65cc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QBoundingVolume: fix unitialized valuedPaul Lemire2020-07-271-0/+1
| | | | | | | Lead to some bounding volumes being invalid (negative of infinite radius) Change-Id: Ie2a5037eed744577139e7d301479c6639fca8e61 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update buffer visitorMike Krus2020-07-272-174/+46
| | | | | | | | 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-205-10/+4
| | | | | | Change-Id: I5af5b180f7b07b885e613c20b84b9904d6906ed5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix build to change in typeof QList::size()Mike Krus2020-07-173-3/+7
| | | | | Change-Id: Ib480a8eef157102df8f89a75983cd4d8d46a9388 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* rhi: fix SubmissionContext::loadShader for Unicode filesNicolas Guichard2020-07-161-7/+12
| | | | | | | | | | | | QRegularExpression::match takes a QString and not a QByteArray, so QRegularExpressionMatch::capturedStart is not reliable to locate bytes in a QByteArray which might contain Unicode data. This fixes the issue by explicitly working on QStrings. Pick-to: 5.15 Change-Id: Ia32ee169718d98e7197d7bfa19ca23e6e243dc25 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RHIBuffer: don't destroy buffer immediately when orphaningPaul Lemire2020-07-163-2/+26
| | | | | | | | We need to keep past QRhiBuffer alive long enough to have submitted any updates we might have already recorded for them. Change-Id: I3807cbca64773b0c61afefd6378ae397b175c2e5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: avoid copies when uploading UBOsPaul Lemire2020-07-162-8/+4
| | | | | Change-Id: I1a33a05020bc4c27ef3dfd1060ab1fb7191120dd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove string concatenations when uploading UBOsPaul Lemire2020-07-164-83/+72
| | | | | | | | - We instead record nameIds when we first parse the shader and use those at submission time. Change-Id: I30dde8df4b0ad44b2b60ae42edd9f8ec09a34e47 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* PipelineKey: use Geometry Layout instead of GeometryIDPaul Lemire2020-07-167-25/+42
| | | | | | | | | | - Allows to create less pipelines - PipelineUBO: use aligned offsets - RenderCommand store ShaderResourceBindings (avoids creatings a new one every frame) and store last used bindings to see if rebuild is required. Change-Id: I3a44d340a92f5c48f150896b9aa9912527b3b1ea Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add AttributeInfo to allow comparing RenderCommand geometry layoutsPaul Lemire2020-07-167-20/+132
| | | | | | | Also start adding tests Change-Id: Ia9d7fb9beaf8623c47bfafd6f5f0751c6571f82f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use a single UBO per binding for all commands using the same pipelinePaul Lemire2020-07-1613-489/+919
| | | | | | | | | | | | | | | | | | | | | | Easier said than done. Main issue is the fact that RHI combines ResourceLayoutDescription and ResourceBinding in the same object. This prevents creating a pipeline solely based on the resource description (which would make sense if you plan on reusing pipelines), instead you need to provide buffers to go with the description. That being said, a RHI patch is on its way to allow providing nullptr for the resources when all we care about is specifying a layout. In the mean time, since we need the binding description to create a pipeline, this forces us to have buffers we will later destroy only to create the pipeline because we don't know yet how many commands will be used. Later improvements to be made are: - Share pipelines based on Geometry layout instead of Geometry NodeId - Find ways to cache link between RenderCommands and Pipelines - Handle cases where user directly provided a UBO as a parameter value Change-Id: Iec989885711d850f672268910f03468149a57f32 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHIBuffer: remove unreachable code pathPaul Lemire2020-07-101-4/+0
| | | | | | Change-Id: I7b1c871557d5b15fd0ab843d2702951581570e27 Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* ES2: Clarify warnings about MSAAPaul Lemire2020-07-101-2/+4
| | | | | | | | | | ES2 supports multisampling, it just doesn't support explicitly disabling multisample like we could do on desktop with glDisable(GL_MULTISAMPLE); Change-Id: I4a070e8fec60b038e141a656ddb359f0dbed441d Pick-to: 5.15 Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* 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>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-09172-554/+531
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RHI: Handle cases where buffer has no dataPaul Lemire2020-07-094-5/+14
| | | | | | | | This can happen if creating a frontend QBuffer and never setting any data on it. Change-Id: Ibfe53931e9f13580514fb28973cb398dfa6e911c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi/renderer: small tidiesPaul Lemire2020-07-091-5/+5
| | | | | | Change-Id: I794a8c205e576b01eceb0d8b117aa643bec29fdc Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com>
* Move RenderViewInitializer,Builder/Updater jobs to a common placePaul Lemire2020-07-0830-1592/+659
| | | | | | | | | 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-085-118/+139
| | | | | | | | 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>
* RHI Renderer: align prepareCommandsSubmission with OpenGL rendererPaul Lemire2020-07-081-7/+1
| | | | | Change-Id: Iaf06325bb44fbe83fe01cb1b89c7d06cf42c1bdd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI: uploadBuffersForCommand check return value of RHIBuffer::bindPaul Lemire2020-07-081-3/+6
| | | | | | Change-Id: Id71e69fc0b6f6cbc1431877b3b2ab3a651177b67 Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVectorJarek Kobus2020-07-0791-239/+238
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic726ce85e01190dbc64426388fd454c54ae3c3e3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* rhi: cleanup code which was only relevant for opengl rendererJean-Michaël Celerier2020-07-073-94/+5
| | | | | Change-Id: Idabb992272886d2f358a9aa4ea5374dc309f98ab Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Move and adapt RendererCache to share amongst renderer pluginsPaul Lemire2020-07-0722-314/+130
| | | | | Change-Id: I4e6e48abdd79b59fe98a916c7f2da6ba92e8ff82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GLTexture: change internals to use std::vectorPaul Lemire2020-07-076-29/+21
| | | | | Change-Id: If680702aed4544395866a7b376db920561bf16cc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderQueue: reset now destroys RenderViewsPaul Lemire2020-07-074-4/+18
| | | | | | | | 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-0714-450/+114
| | | | | | | 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-0737-1866/+1006
| | | | | | | | | | - 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>
* RHI: Fix a couple warningsPaul Lemire2020-07-071-1/+3
| | | | | Change-Id: I23e1d89ba354843d354e8dc5b4044e400a64f5c0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GLShader: convert some std::vector getter to return const &Paul Lemire2020-07-072-10/+10
| | | | | Change-Id: I2e6da482f902c891832faf82e63259f55695a6cf Reviewed-by: Mike Krus <mike.krus@kdab.com>
* OpenGL Renderer: replace std::find by Qt3DCore::containsPaul Lemire2020-07-076-30/+19
| | | | | | | More concise and easier to read Change-Id: I67d93ff213842cfcc0263e244d89ba1e9a73982b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: replace QVector by std::vector wherever possibleJean-Michaël Celerier2020-07-0720-348/+299
| | | | | Change-Id: I0020df0a0ce3b53e62dd9e4e5faad92583f9dbcc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI Logging: Fix categories names to mention RHI and not OpenGLPaul Lemire2020-07-041-12/+12
| | | | | Change-Id: I0f450e32453d52bf8125eadb1fa32d350f481d0b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: handle a depth texture formatJean-Michaël Celerier2020-07-042-0/+10
| | | | | | | Needs relevant patch to go in qtbase before being merged Change-Id: I1c477f8866af45ff30e1ce9a6757ebb8f6823a67 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update RHI plug-in with std::vector changesJean-Michaël Celerier2020-07-0314-194/+248
| | | | | Change-Id: I2a4952ac086916fcdca80845ea74d9140ee597db Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderQueue: switch to std::vectorPaul Lemire2020-07-0312-195/+130
| | | | | 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>
* RHI: Texture FixesPaul Lemire2020-07-031-7/+23
| | | | | | | | | - Property destroy() RHITexture, delete doesn't automatically call destroy() - Fix single image upload, we were passing the GL enum face value instead on the face index RHI expects Change-Id: I0f2f11c2b8381f9f334dd73fb16af01728e2bf9c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GraphicsHelpers/GLShader: switch to std::vectorPaul Lemire2020-07-0333-222/+226
| | | | | Change-Id: I8be6695e0c52dfbe353cd381d94548aba1c7da82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* APIShaderManager: switch to std::vectorPaul Lemire2020-07-033-14/+30
| | | | | Change-Id: Ied22ef9dea4cd3043f9f3d5ec69d7628e60b7dd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* OpenGL: TextureSubmissionContext switch to vectorPaul Lemire2020-07-032-8/+8
| | | | | Change-Id: I9411ef4ffeb2d2ade0cbbe18f710d48c70fee7ef Reviewed-by: Mike Krus <mike.krus@kdab.com>
* AttachmentPack: use std::vectorPaul Lemire2020-07-034-10/+10
| | | | | Change-Id: Iba6a5ca2a1b7f5bb1d93d1e406f23f31f6f1efd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-0234-90/+99
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>