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
Gerrit Reviews
For Gerrit Dashboard: QTCREATORBUG-27068 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
649225,8 | GLSL: Fix handling of interface blocks | master | qt-creator/qt-creator | Status: NEW | +2 | +1 |