OpenGL Shader Version Compile Error

a 夏天 提交于 2020-01-11 09:18:05

问题


I have a problem when compiling a simple vertex shader in OpenGL, I get the following error messages:

  • error(#106) Version number not supported by GL2
  • error(#279) Invalid layout qualifier 'location'

I assume that I must be using the wrong version of GL2, but I have no idea how to find my version number or where to go for an upgrade (and yes I tried to search for an answer.) Attached is a copy of my shader code just for reference and my openGL information.

#version 330 core

layout(location = 0) in vec3 Position;

void main() {
    gl_Position.xyz = Position;
}
  • Vendor: ATI Technologies Inc.
  • Renderer: ATI Radeon HD 5700 Series
  • Version: 3.2.9756 Compatibility Profile Context

回答1:


#version 330 core

This says that your shader uses GLSL version 3.30.

This:

Version: 3.2.9756 Compatibility Profile Context

Means that your OpenGL version is 3.2. The GLSL version that corresponds with OpenGL 3.2 is 1.50. Which is less than 3.30. Hence the lack of compilation.

Update your drivers; those are extremely old. Your card should be able to support GL 4.2.



来源:https://stackoverflow.com/questions/12631437/opengl-shader-version-compile-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!