ronag
ronag

Reputation: 51255

Intel and GLSL - Failed to compile fragment shader

I'm running into a rather strange GLSL compilation error while using Intel HD Graphics 3000.

ERROR: 0:130: 'switch' : no matching overloaded function found (using implicit conversion)
ERROR: 0:131: '{' : syntax error parse error

12  uniform int pixel_format;   
...
128 vec4 get_rgba_color()                                                               
129 {                                                                                   
130     switch(pixel_format)                                                            
131     {

Any ideas what might be causing this and how to get around it?

Upvotes: 2

Views: 2047

Answers (1)

Ville Krumlinde
Ville Krumlinde

Reputation: 7131

The switch-statement was added to GLSL version 1.3.

Try inserting the line "#version 130" at the top of your shader source.

If that doesn't help then your GPU does not support it and you need to use nested if-statements instead.

Upvotes: 7

Related Questions