summaryrefslogtreecommitdiffstats
path: root/src/render/texture/textureimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated classes and functionsPaul Lemire2020-02-111-2/+2
| | | | | | | Mostly old messaging API Change-Id: I17eb2206b2ede56d2f7d36375d5e711d6149019f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up includesMike Krus2019-10-011-1/+0
| | | | | | | | | Remove include statements for classes that are no longer used. Makes it easier to find remaining use cases that need addressed before complete removal in Qt 6. Change-Id: I60529ba1929ad64b162d3847d5df47cde2a60dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QAbstractTextureImage to use direct syncPaul Lemire2019-09-251-25/+28
| | | | | Change-Id: Ide55f36fc7e1ac197313307a1c3e58c06ac690a1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Rework internal Texture HandlingPaul Lemire2019-03-041-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* Fix: Do not enforce TextureImage to be parented only by TexturePaul Lemire2018-07-181-21/+8
| | | | | | | | | | | | | | | | | | | | This behavior prevented using TextureImage not directly parented by the Texture that uses them (assert would be triggered). In turn, this also prevents sharing a TextureImage among several Texture instances which is counter productive since this is where the data is actually stored. This patch fixes this issue. It removes all direct coupling between Texture and TextureImages. Now Texture only contains the list of TextureImage ids it references. This allows to not make look-ups into the TextureImageManager to retrieve handles, which could be an issue if TextureImages have not yet had their backend created. TextureImage doesn't keep track of the referencing texture that uses it anymore. Instead, we let the renderer do the job of checking if any of the TextureImage referenced by a Texture has changed to trigger actual Texture update. Change-Id: I3c63379d0f4b314e9b53f225870eeaded0bb4aec Task-number: QTBUG-69407 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Load textures in a single framePaul Lemire2018-02-281-5/+24
| | | | | | | | | | | | | | | | | Because of texture sharing, Qt3D compares functor before executing them. Instead of blindly loading a TextureImage functor which could turn out to not be used, Qt3D required 2 frames to fully update a texture. This behavior has been removed, now when a texture image functor is updated, it updates the texture in one frame. It is assumed that the user is responsible for declaring only TextureImage that he is actually going to use. Any scene that uses OnDemand rendering and frequently changes a texture image functor can be used to test this. (ex-painted-cube is a good example for KDAB) or paintedtexture-cpp in manual tests Change-Id: I8c2f13876244a862633e10e472e2b49cbd6e126b Task-number: QTBUG-63561 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename Texture::DirtyGenerators to DirtyImageGeneratorsWieland Hagen2017-01-261-1/+1
| | | | | | | To distinguish clearly from DirtyDataGenerator Change-Id: Ib170529c027f24bf848a25f99dd34352a1d1030e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture: further refactoringPaul Lemire2016-11-141-1/+1
| | | | | | | | | Remove deep coupling between Texture and GLTexture The renderer is the only link between the two which should allow to reuse Texture with various renderers. Change-Id: I01e0a119744b9ec589c7b45d2ff482a70ea53d3b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture backend refactoring: Simplify TextureImageWieland Hagen2016-11-141-90/+19
| | | | | | | | TextureImage will basically just hold the frontend data and notify the texture holding it about changes. Change-Id: I2f4bc18a8b667cd4036d02250574e88831498035 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture loading improvementPaul Lemire2016-06-301-7/+19
| | | | | | | | | - use texture image data for hash generation - use std::move for pending texture clearing in TextureDataManager - do not add the texture to be loaded again when the status changes Change-Id: Ia0a2670211c890307eebaec6a125a5b4e928a1f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move QTextureImageDataGenerator to its own headerPaul Lemire2016-05-201-0/+1
| | | | | Change-Id: I0f80f7bafefb904c8171ff89f24687d15acd4b50 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove QBackendNodePropertyChangeSean Harmer2016-05-131-2/+2
| | | | | | | | Not needed as we can just use delivery flags on QPropertyUpdatedChange. Task-number: QTBUG-51494 Change-Id: I53b52ac7a1b226dd30756bcebcdd62bffd3a6fd5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodePropertyChange -> QPropertyUpdatedChangeSean Harmer2016-05-101-2/+2
| | | | | | Task-number: QTBUG-51494 Change-Id: Ic326499f80b5a91b2d19c09770de926f220cc805 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename NodeUpdated ChangeFlag to PropertyUpdatedSean Harmer2016-05-101-1/+1
| | | | | | | | This more correctly reflects the semantic meaning. Task-number: QTBUG-51494 Change-Id: I3a230e959ea007f1d19808eae73b5d95b6f06514 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove setTargetNode()/targetNode() from backend property changesSean Harmer2016-05-031-1/+0
| | | | | | | Now uses subjectId() instead. Change-Id: Ib307e2a008559bfa5ea7c93a1e5806cbe1b1cb5c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove QBackendNode::updateFromPeer()Sean Harmer2016-05-031-21/+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 virtual QBackendNode *create(QNode *frontend) constSean Harmer2016-05-011-11/+0
| | | | | | | | from QBackendNodeMapper and subclasses. No longer needed now we have disabled cloning. Change-Id: I261fa7bccfa9a4019d479079e2ff7c19154e5e72 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Q_NULLPTR -> nullptrSean Harmer2016-05-011-8/+8
| | | | | | Task-number: QTBUG-52736 Change-Id: I58f9cbcdf018e7b672d33dd865067485412b79fe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QBackendScenePropertyChange -> QBackendNodePropertyChangeSean Harmer2016-04-221-2/+2
| | | | | Change-Id: I875537e511b93d9bfd002fa9fa2a368999f7e75a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QBackendScenePropertyChange cleanupsSean Harmer2016-04-221-1/+1
| | | | | | | | Now inherits from QNodePropertyChangeBase and sets change flag so user's don't have to. Change-Id: I47892d73b63627664c6fa57c8b0c7ef5c4bdd3c8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix TextureImage source update.Mauro Persano2016-04-211-1/+1
| | | | | | Change-Id: I4daa7047aa0f8583841b12f47d3ba1389405428b Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QScenePropertyChange -> QNodePropertyChangeSean Harmer2016-04-211-2/+2
| | | | | | | Trying to unify naming of change types. Change-Id: I0bfca0b7ba5adeaaa6145f75ddb41731f76adc09 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix make TextureImage ReadWritePaul Lemire2016-04-201-1/+1
| | | | | Change-Id: I1ee1ed145309f8b9589ef716e72b108596ed8af3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Changes to handle ScenePropertyChangeRobert Brock2016-04-191-0/+11
| | | | | | | | TextureImage loading job now notifies frontend Change-Id: I6d725e4343c4f36a918c4deb38e6c832970fa5e8 Task-number: QTBUG-51453 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* TextureImage: use m_enabled member from base classPaul Lemire2016-04-151-0/+2
| | | | | Change-Id: I4525feea89eb1ac25ba4dbacea031113511234ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractTextureImage creates creation changesSean Harmer2016-04-101-0/+23
| | | | | | | Backend type handles them too. Change-Id: Ibd87c2e5a464c0953c1b017db21e7831ca4c6681 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QAbstractTextureProvider renamed to QAbstractTexturePaul Lemire2016-04-061-4/+4
| | | | | | Change-Id: If8ea2c9806e28f6d97eb3fb852686647c0c04d8f Task-number: QTBUG-51504 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* TextureImageFunctor handles creationSean Harmer2016-03-311-0/+10
| | | | | Change-Id: Ibf4aec46eae85a7670143672c00e636b673d9bce Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QTextureDataFunctor to QTextureImageDataGeneratorFranck Arrecot2016-03-071-3/+3
| | | | | | Task-number: QTBUG-51447 Change-Id: I3cb1cd3e2e225288e781c04f274518dde483a69a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QBackendNode::peerUuid() renamed to peerId()Paul Lemire2016-03-051-1/+1
| | | | | Change-Id: I72471d0b22d16bbbee33610e30a06daadffedbd9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QAbstractTextureImage rename cubeMapFace to faceRobert Brock2016-02-291-2/+2
| | | | | | | As per API review Change-Id: I6c23956ee50c56fa27f50ccf8d484698be706cf9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractTextureImage mipmapLevel now mipLevelRobert Brock2016-02-291-6/+6
| | | | | | | | Checked qlight test is running As per API review Change-Id: Ie27271612e0bfad4ead2361e45f53cd13f692165 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove ParameterMappingPaul Lemire2016-02-261-1/+1
| | | | | | | | | | | | | | * 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>
* Propagate backend node changes to Renderer; render-on-demandWieland Hagen2016-02-241-0/+1
| | | | | | | | | | | | Each sceneChangeEvent marks a dirty bit in the AbstractRenderer. If no changes were accumulated during one frame, the renderer decides not to render the frame, by returning false from shouldRender(). We still need to go through each backend node and see what flags to set exactly, and to make sure we also react on backend-initiated changes. Change-Id: I80588bc5c4ebeb5d57b45ddfbd4d79ec268968b1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Added AbstractRenderer pointer to RenderBackendNodeWieland Hagen2016-02-241-3/+5
| | | | | | | | Modified all node functors to pass QRenderAspect's renderer instance to all newly created backend nodes Change-Id: Iffa4941bff53f6acf87f46789219c7ae2f123615 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Dedicated QRenderBackendNodeWieland Hagen2016-02-241-1/+1
| | | | | | | | | 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>
* const QNodeId & -> QNodeIdPaul Lemire2016-02-221-2/+2
| | | | | Change-Id: Ia672918cbae3b950e20e68bfbfd6982676a5981e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-191-1/+4
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ia78be95187077c194b99063730259f9dd3ca0c86
| * Make TextureImage DNA more robust to collisions.Wieland Hagen2016-02-041-1/+4
| | | | | | | | | | | | Task-number: QTBUG-50076 Change-Id: Iab8cac610bd9e14885d3f583b17b2e7e3a642e2f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Removed factory member variableRobert Brock2016-02-071-2/+1
| | | | | | | | | | | | | | | | | | The variable was removed from QBackendNode and subsequently all areas it appeared. Task-number: QTBUG-49682 Change-Id: I5904714b55aaefbe07ee11008ff49cd1d9b89950 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 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-6/+6
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move texture classes to their own directorySean Harmer2015-10-131-0/+188
Change-Id: I026cad678b06d8d785f7652f42d1dccc2fede88a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>