Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88420

Improve image data handling

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 6.0.1, 6.1
    • 6.0.0
    • Quick: 3D
    • Qt Quick 3D - 49/50, Qt Quick 3D - 51/52

    Description

      The way we store and reference textures needs to change due to QTBUG-88241QTBUG-88423 This is not a reasonable change for Qt 6.0 anymore because it will involve a significant rewriting of code in QSGBufferManager and elsewhere.

      The goal is to implement something that matches the patterns used for meshes, i.e. where the prepareImage step retrieves some (cached) object from the pre-window/per-thread BufferManager, encapsulating the (per-window/per-thread) native graphics resources. (a'la QSSGRenderMesh)

      Relying on the backend node (QSSGRenderImage) must go away, similarly to how a QSSGRenderModel is not used at all once prepareModelForRender has done its job.

      The code base inherited from Qt 3D Studio is sadly not quite maintainable in practice. For example, the way QSSGBufferManager is architected with the unfortunate mess of overloads for loadRenderImage, with functions calling each other back and forth for no real reason, often without clear input/output argument separation, defying many API design principles, is not sustainable.

      As of now we know of the following problems at minimum:

      • Texture in combination with Default/PrincipledMaterial
        •  Texture.source
          • Does not use the correct texture when there is more than one View3D in different windows (and so threads) with the same importScene
        • Texture.sourceItem
          • Does not use the correct texture even when there is just one View3D with an importScene.
          • Crashes when there is more than one View3D in different windows (and so threads) with the same importScene. [this case cannot work when the threaded render loop is used, but it should still fail gracefully somehow]
        • Texture.textureData
          • To be tested in combination with importScene. Expectation is that it behaves similarly to Texture.source.
      • Texture in combination with CustomMaterial or Effect:
        • To be tested in combination with importScene. The Texture.source case may work for Textures in a TextureInput in a custom property, because what happens under the hood there is closer to what we'd like to see for all images (i.e. it calls directly into the per-window/per-thread BufferManager, so it gets appropriate native resources for the current window/thread)
      • Model
        •  Model.source
          • Ok
        • Model.geometry
          • To be tested in combination with importScene

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-88420
          # Subject Branch Project Status CR V

          Activity

            People

              lagocs Laszlo Agocs
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes