Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-988

PySide2 : setAttributeArray of QOpenGLShaderProgram does not have effect

    XMLWordPrintable

Details

    • Windows
    •  f42fe9365ba04e31aa8adb7d6d3942990b80104d (pyside-setup/5.12, 15.4.2019, 5.12.3)

    Description

       

      In the following code, it was found that setAttributeArray has no effect and because of that, glDrawArrays is caught for exception. See attached python.3.trace for more details. 

       

      values=(
             1,-1,
             1,-1,
            -1,1,
             1,1)
      np_values = np.array(values)
      stride  = 2
      
      #This has no effect
      self.program.setAttributeArray(0, GL_FLOAT, np_values, len(values), stride)   
      
      self.program.setUniformValue( "t", self.t )
      
      glf.glViewport(0, 0, self.viewportSize.width(), self.viewportSize.height());
      
      glf.glDisable(GL_DEPTH_TEST)                
      glf.glClearColor( 0.0, 0.0, 0.0, 1.0 )
      glf.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
      glf.glEnable(GL_BLEND)
      glf.glBlendFunc(GL_SRC_ALPHA, GL_ONE)
      
      # Because setAttributeArray fails to set values, this fails. 
      glf.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4 )
      

       

       

      Attachments

        1. pyside988.zip
          8 kB
        2. Pyside-988-sample.zip
          4 kB
        3. python.3.trace
          93 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-988
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              nagrohn Nahomi Gröhn (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes