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

Using an array of TextureLoaders in a Parameter does not work

    XMLWordPrintable

Details

    Description

      If I've got an array of samplers declared in a shader like uniform sampler2D textures[4]; and I want to set the respective textures I hit QML language limitations and a crash into Qt 3D.

      If I do:

              Parameter {
                  name: "textures[0]"
                  property var textures: [
                      TextureLoader { source: ASSETS_PATH + "/cell-images/aSMA_Her2b-TMA-49-B3.dds" },
                      TextureLoader { source: ASSETS_PATH + "/cell-images/CD20_Her2b-TMA-49-B3.dds" },
                      TextureLoader { source: ASSETS_PATH + "/cell-images/CD3a_Her2b-TMA-49-B3.dds" },
                      TextureLoader { source: ASSETS_PATH + "/cell-images/CD3_Her2b-TMA-49-B3.dds" }
                  ]
                  value: textures
              },
      

      I've got a syntax error (not even sure coming from where: Expected token `,'.

      If I change the type from var to list<QtObject> then the syntax error is gone, but Qt3D doesn't load the textures at all.

      If I declare the texture loaders elsewhere and then do this:

              Parameter {
                  name: "textures[0]"
                  property var textures: [ textureLoader1, textureLoader2, textureLoader3, textureLoader4 ]
                  value: textures
              },
      

      Then this crashes with an assert:

      ASSERT failure in Q_UNREACHABLE(): "Q_UNREACHABLE was reached", file backend/uniform.cpp, line 95
      

      Attachments

        1. qtbug-61759.zip
          34 kB
        2. qtbug-61759.zip
          12 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            seanharmer Sean Harmer
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes