Skip to main content
gamedev.net
🔒 Locked

[help] GLSL compile errors

Started by RongYang 0 replies 2.7k views
Original Post
RongYang
RongYang
hi guys,
I am trying to compile the following simple shader program and using version 3.3
The graphics card I am using is ATI Radeon HD 5470

pixel shader:


#version 330

in vec4 fragColor;

out vec4 outputColor;

void main()

{

outputColor = fragColor;

}

vertex shader:



#version 330

layout(location = 0) in vec4 position;

layout(location = 1) in vec4 color;

out vec4 outputColor;

void main()

{

gl_Position = position;

outputColor = color;

}



But I got comple errors:


[font="Consolas"][size="1"][font="Consolas"][size="1"]ERROR: 0:1: error(#106) Version number not supported by GL2

ERROR: 0:3: error(#279) Invalid layout qualifier 'location'

ERROR: 0:4: error(#279) Invalid layout qualifier 'location'

ERROR: error(#273) 3 compilation errors. No code generated

ERROR: 0:1: error(#106) Version number not supported by GL2

ERROR: 0:3: error(#279) Invalid layout qualifier 'location'

ERROR: 0:4: error(#279) Invalid layout qualifier 'location'

ERROR: error(#273) 3 compilation errors. No code generated


Any one got any idea about the errors?

Thanks in advance!


[/font][/font]
nhold
nhold

[font="Consolas"][size="1"][font="Consolas"][size="1"]ERROR: 0:1: error(#106) Version number not supported by GL2
[/font][/font]


First error first!

You need to create a higher OpenGL Context.

http://www.opengl.or..._OpenGL_Context


If you need any help feel free to post back. (Make sure to include your target OS and if you want backwards compat)
Engineering Manager at Deloitte Australia

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.