XMLWordPrintable

Details

    • Sub-task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Editors
    • Linux/X11

    Description

      GLSLEditor plugin incorrectly highlights error

      GLSL has an entity called *Interface block https://www.khronos.org/opengl/wiki/Interface_Block

      When referring to variables from the Interface block in the code, the editor underlines this call in red. When hovering the mouse, a pop-up text is displayed:
      Requested for member '...', in a non class or vec instance

      At the same time, this shader is correct and works well.

      Here is the GLSL code to reproduce the problem: 

       

      #version 330 core
      
      layout(location = 0) in vec3 aPos;
      layout(location = 1) in vec3 aNormal;
      layout(location = 2) in vec2 aTextCoords;
      layout(location = 3) in vec3 aTangent;
      layout(location = 4) in vec3 aBitangent;
      
      out VertexOut {
          vec2 textCoords;
          vec3 normal;
          vec3 fragPos;
          vec3 viewPos;
          vec3 lightPos;
      }
      vertexOut;
      
      uniform mat4 model;
      uniform mat4 view;
      uniform mat4 projection;
      
      uniform vec3 viewPos;
      uniform vec3 lightPos;
      
      void main() {
          mat3 normalMatrix = transpose(inverse(mat3(model)));
      
          vec3 T = normalize(normalMatrix * aTangent);
          vec3 N = normalize(normalMatrix * aNormal);
          T = normalize(T - dot(T, N) * N);
          vec3 B = cross(N, T);
      
          mat3 TBN = transpose(mat3(T, B, N));
      
          vertexOut.textCoords = aTextCoords;
          vertexOut.normal = TBN * N;
          vertexOut.fragPos = TBN * vec3(model * vec4(aPos, 1.0));
          vertexOut.viewPos = TBN * viewPos;
          vertexOut.lightPos = TBN * lightPos;
      
          gl_Position = projection * view * model * vec4(aPos, 1.0);
      }
      

       

      I am attaching a screenshot with the specified behavior:

         

       

      Attachments

        1. glsl_error.png
          73 kB
          rumgot
        2. glsl_error-1.png
          101 kB
          rumgot
        For Gerrit Dashboard: QTCREATORBUG-27068
        # Subject Branch Project Status CR V

        Activity

          People

            cstenger Christian Stenger
            rumgot rumgot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change