GLSL版本1.20允许GLSL Uniforms初始化

Did*_*diZ 2 opengl intel glsl

我收到以下错误:

WARNING: uniforms initializing is allowed from GLSL version 1.20
WARNING: Only GLSL version > 110 allows postfix "F" or "f" for float
Run Code Online (Sandbox Code Playgroud)

虽然我知道如何解决这个问题,但我想知道为什么会发生这种情况,因为这个机器出现了OpenGL 3.1,因此有GLSL 1.4:

12:40:58 [INFO] Intel(R) HD Graphics Family
12:40:58 [INFO] OpenGL 3.1.0 - Build 8.15.10.2509
Run Code Online (Sandbox Code Playgroud)

编辑:有问题的着色器是一个fragement着色器(没有顶点着色器):

uniform sampler2D sampler;
uniform sampler2D bump;

uniform float imageSize;
uniform float range = 50;

void main() {
    vec2 pos = gl_TexCoord[0].xy;

    float height = texture2D(bump, gl_TexCoord[0].xy).r - 0.5;

    pos.y += height * range / imageSize;

    gl_FragColor = texture2D(sampler, pos);

            //gl_FragColor = texture2D(sampler, pos) *  (1 + (height - 0.3f) * 25);
}
Run Code Online (Sandbox Code Playgroud)

Nic*_*las 6

GLSL规范声明如果着色器不提供#version指令,则它假定版本为1.10.确保始终#version在着色器顶部提供指令.