Qt
  1. Qt
  2. QTBUG-58585

Black widgets and windows using QML

    Details

    • Type: Bug Bug
    • Status: Reported
    • Priority: P2: Important P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.7.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Description

      I've been having an issue with a cordova-ubuntu app, which I traced to the Oxide webview which I've finally traced to QT/QML (or so I think).

      In short, I'm getting black windows and buttons rather than an actual display.

      You can see the original demo of the problem on
      https://www.youtube.com/watch?v=WraR3pq12vE
      that demonstrates the cordova problem.

      However, a simplified test as attached in the screenshot here reveals the same issue, using qmlscene and a very basic hello world scene.

      Running
      qmlscene --verbose test.qml
      outputs
      QSGTextureAtlas: texture atlas allocation failed, code=501

      Using apitrace, I can see errors like
      major api error 17: GL_INVALID_OPERATION in glTexSubImage2D(invalid texture image)

      owing to calls to
      glTexSubImage2D(target = GL_TEXTURE_2D, level = 0, xoffset = 0, yoffset = 26, width = 36, height = 1, format = GL_BGRA, type = GL_UNSIGNED_BYTE, pixels = blob(144))

      I am inclined to believe this is related to the format (GL_BGRA) but this is more a hunch than anything.

      Running with every debug flag I could lay my hands on:

      QT_XCB_FORCE_SOFTWARE_OPENGL=1 LIBGL_ALWAYS_SOFTWARE=1 LIBQML_DUMP_ERRORS=1 QML_XHR_DUMP=1 QML_CHECK_TYPES=1 QML_DEBUGGER_VERBOSE=1 MALIIT_DEBUG=1 QT_QPA_EVDEV_DEBUG=1 QT_QPA_EGLFS_DEBUG=1 QT_QPA_EVDEV_DEBUG=1 QT_DEBUG_BACKINGSTORE=1 QT_DEBUG_PLUGINS=1 DEBUG=1

      outputs the attached "debugoutput.txt".

      Any indications on how to circumvent or resolve would be much much appreciated.

      Please let me know if you need more data.

      1. debugoutput.txt
        15 kB
        Pat Deegan
      2. test.qml
        0.6 kB
        Pat Deegan
      1. cordovaapp.png
        34 kB
      2. qmlscene.png
        10 kB
      3. qmlscene.png
        2 kB
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        Laszlo Agocs added a comment -
        QT_XCB_FORCE_SOFTWARE_OPENGL=1 LIBGL_ALWAYS_SOFTWARE=1
        

        hmm this would indicate that you are using Mesa llvmpipe. But then the vendor/renderer strings cannot be the ones that are shown in the Environment field.

        Show
        Laszlo Agocs added a comment - QT_XCB_FORCE_SOFTWARE_OPENGL=1 LIBGL_ALWAYS_SOFTWARE=1 hmm this would indicate that you are using Mesa llvmpipe. But then the vendor/renderer strings cannot be the ones that are shown in the Environment field.
        Hide
        Pat Deegan added a comment -

        Don't know if this means anything, but it happens with or without the flags being set.

        I can provide further info as required, just let me know what tests to run.

        Show
        Pat Deegan added a comment - Don't know if this means anything, but it happens with or without the flags being set. I can provide further info as required, just let me know what tests to run.
        Hide
        Pat Deegan added a comment -

        Workaround and bug potentially isolated...

        After a good deal of sleuthing, I found a section in the quick scenegraph texture atlas code:
        https://git.merproject.org/mer-core/qtdeclarative/blob/c4b4324596302b6c630187388b18dbdedaaaf7e1/src/quick/scenegraph/util/qsgatlastexture.cpp#L137

        which seems to be setting the external/internal formats to different values and might be the source of the issue.

        Running qmlscene while disabling the bgra MESA extension finally gives visible results, and exporting the flag in the environment lets the cordova-ubuntu app run correctly, as shown in the newly attached images.

        The specific command run was
        MESA_EXTENSION_OVERRIDE="-GL_EXT_bgra -GL_EXT_texture_format_BGRA8888" qmlscene tmp/test.qml

        Not certain how to fix permanently, but this should give a hint on where to look.

        Thanks,
        Pat D

        Show
        Pat Deegan added a comment - Workaround and bug potentially isolated... After a good deal of sleuthing, I found a section in the quick scenegraph texture atlas code: https://git.merproject.org/mer-core/qtdeclarative/blob/c4b4324596302b6c630187388b18dbdedaaaf7e1/src/quick/scenegraph/util/qsgatlastexture.cpp#L137 which seems to be setting the external/internal formats to different values and might be the source of the issue. Running qmlscene while disabling the bgra MESA extension finally gives visible results, and exporting the flag in the environment lets the cordova-ubuntu app run correctly, as shown in the newly attached images. The specific command run was MESA_EXTENSION_OVERRIDE="-GL_EXT_bgra -GL_EXT_texture_format_BGRA8888" qmlscene tmp/test.qml Not certain how to fix permanently, but this should give a hint on where to look. Thanks, Pat D

          People

          • Assignee:
            Shawn Rutledge
            Reporter:
            Pat Deegan
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes