Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.9
-
None
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