내가하여 컨텍스트를 만들 GLSL 때 나는 하나 개의 확장 EXT_texture_compression_s3tc
와 OpenGL을 3.3 핵심 정보에 대한 glLoadGen으로 확장을로드하고있어오류 컴파일 쉐이더 3.30
new sf::Window(sf::VideoMode(800, 600), "OpenGL",
sf::Style::Default,
sf::ContextSettings(24, 8, 0, 3, 3, sf::ContextSettings::Core)));
. 내가 쉐이더를 컴파일있을 때 :
ERROR: Shader compilation error at shader: "media/shaders/shader.vs.glsl"
0:7(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
0:8(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
0:9(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
하지만 OpenGL을 3.3 (3.30 그래서 GLSL)이 있습니다
#version 330 core
layout (location = 0) in vec3 vertPos;
layout (location = 5) uniform mat4 modelMat;
layout (location = 6) uniform mat4 viewMat;
layout (location = 7) uniform mat4 projectionMat;
out vec4 fragColor;
void main()
{
gl_Position = projectionMat * viewMat * modelMat * vec4(vertPos, 1.0);
fragColor = vec4(0.5, 0.5, 0.5, 1.0);
}
``
#version 330 core
in vec4 fragColor;
out vec4 outColor;
void main()
{
outColor = fragColor;
}
나는 오류 문자열을 얻을. glxinfo
지문 :
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD JUNIPER (DRM 2.43.0, LLVM 3.8.0) (0x68be)
Version: 11.2.0
Accelerated: yes
Video memory: 512MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD JUNIPER (DRM 2.43.0, LLVM 3.8.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
그래서 나는 수 사용 GLSL 3.30이어야한다.
: 당신은 3.30 쉐이더로 유지하기를 원하며 (대신 AMD의 드라이버의 오픈 소스 드라이버를 사용하고 있기 때문에) 확장으로 사용할 경우, 당신은
#version
선언 아래 extension declaration가 필요합니다 'GL_ARB_explicit_uniform_location' 확장이 실제로 존재합니까? 오류 메시지의 표현에서 glsl 3.30이 사용 가능할지라도 추측하고 있습니다. –사용 가능 합니다만, 메시지는'GLSL 3.30'이나'OpenGL core profile shading language version string : 3.30'을 가지고 있습니다. – bajos