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

error C7513: OpenGL does not allow attribute variables in fragment shaders

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.3.0
    • Qt3D
    • None
    • Linux/X11, Windows

      The attached code compiles just fine, but I get a runtime error.

      It seems like the auto-generated fragment shader uses attributes which is not allowed and results in the error. Sadly I do not understand what exactly I'm doing wrong or how to resolve this error.

      QOpenGLShader::compile(Fragment): 0(7) : error C7513: OpenGL does not allow attribute variables in fragment shaders
      *** Problematic Fragment shader source code ***
      #version 110
      #ifdef GL_KHR_blend_equation_advanced
      #extension GL_ARB_fragment_coord_conventions : enable
      #extension GL_KHR_blend_equation_advanced : enable
      #endif
      #define lowp
      #define mediump
      #define highp
      #line 1
      #define LAYER_diffuse
      #define LAYER_specular
      #define LAYER_normal
      uniform highp vec3 eyePosition;
      attribute highp vec3 worldPosition;
      attribute highp vec3 worldNormal;
      uniform highp float shininess;
      uniform highp vec4 ks;
      uniform highp vec4 kd;
      uniform highp vec4 ka;
      
      ... <source code of qt3d/src/extras/shaders/es2/phong.inc.frag> ...
      
      void main()
      {
          gl_FragColor = (((((((phongFunction(ka, kd, ks, shininess, worldPosition, normalize(((eyePosition - worldPosition))), normalize(worldNormal)))))))));
      }

      After some searching around here, it seems like this could be a duplicate of QTBUG-99019
      further clarification would be great though!

        1. main.cpp
          0.6 kB
        2. main.qml
          1.0 kB
        3. qtdiag6.txt
          12 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            seanharmer Sean Harmer
            c.geist Christoph Geist
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes