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

QSGMaterial::updateState(...) needs to leave with glActiveTexture(GL_TEXTURE0);

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.12.2
    • Quick: SceneGraph
    • None
    • arm, mali
    • Linux/Yocto

    Description

      I have a QSGMaterial that binds an external texture to a shader:

      The code looks like:

              glActiveTexture(GL_TEXTURE7);
              glGenTextures(1, &texId);
              glBindTexture(GL_TEXTURE_EXTERNAL_OES, texId);
              glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
              glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage);
              program()->setUniformValue(texId, 7);
      
      
              // Qt expects us to activate GL_TEXTURE0 after rendering
              glActiveTexture(GL_TEXTURE0);
      

      Note: GL_TEXTURE7 is an arbitrary texture unit

      Qt seems to expect GL_TEXTURE0 beeing activated when leaving the updateState otherwise you'll get corrupted textures.

      Attachments

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

        Activity

          People

            janichol Andy Nichols
            georgleugner Georg Leugner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes