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

QtWayland may display black window instead of the texture passed by the shm buffer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Duplicate
    • Affects Version/s: 5.9.4
    • Fix Version/s: 5.11.0 Beta 3
    • Component/s: QPA: Wayland
    • Labels:
      None
    • Environment:
      TI AM335x/AM437x EVM

      Description

      This problem was observed with QT5.7.1 on the TI AM335x/AM437x EVM initially.
      For all software-rendering application, the qwindow-compositor will display a black rectangle with the same size of the expected window. But the same application (binary) works fine on the TI AM537x EVM.

      Our GPU vendor pointed out the root cause of this problem as described below:
      On OpenGL ES 2 core implementation, only GL_CLAMP_TO_EDGE parameter is supported as wrap mode for NPOT (non power of two dimension) textures. However, the default parameter is GL_REPEAT.
      An extension OES_texture_npot however adds the support of other GL_REPEAT and GL_MIRRORED_REPEAT to the wrap modes.

      On GPU cores (AM57xx woth SGX544 for example) for which OES_texture_npot extension is supported, we get the expected output. However when this extension is not supported (AM335x/AM437x with SGX530 for example), texture remains inconsistent and black placeholder is visible instead of intended texture.

      Proposed solution:
      They believe that it is up to the application to check the extension string before using default repeat mode with npot textures and the proposed fix is something like:

      if(textureIsNPOT(appwidth, appheight) && strstr(gles2ExtensionString, "GL_OES_texture_npot") == NULL)
      \{
       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
      }
      

      Or just use GL_CLAMP_TO_EDGE for all cases.

      We have verified the following changes at QT5.7.1 and QT5.9.4 respectively.

      QT5.7.1: sample application qwindow-compositor change:

      GLuint View::getTexture(GLenum *target)
      \{
      
      ...
      
      if (buf.isShm()) \{
       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       {color:#ff0000}glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);{color}
      {color:#ff0000} glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);{color}
       }
      
      }
      
      QT5.9.4 (11.0): src/compositor/wayland_wrapper/qwlclientbuffer.cpp:
      QOpenGLTexture *SharedMemoryBuffer::toOpenGlTexture(int plane)
      \{
      ...
      
      if (m_textureDirty) \{
       m_textureDirty = false;
       m_shmTexture->bind();
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       {color:#ff0000}glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); {color}
      {color:#ff0000} glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); {color}
      
      }
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              johanhelsing Johan Helsing
              Reporter:
              ericruei Eric Ruei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes