cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

desperateamddeveloper
Journeyman III

GLSL compiler error: type mismatch for mix as select

Driver Packaging Version: 14.10.1006-140417a-171099C

Catalyst Version: 14.4

Code:

uvec4 func( )

{

    return mix( uvec4(0), uvec4(1), bvec4(true) ) ;

}

Error:

error(#247) Function return does not match type


But OpenGL QuickRef. Card says:

T mix( T x, T y, bvec )

So whats the matter? What does mix return in the code example?

Thanks,

Alex

0 Likes
1 Solution

Hi Alex,

Try changing uvec4 to vec4. The documentation for mix is here:

https://www.opengl.org/sdk/docs/man/html/mix.xhtml

According to the OpenGL documentation, genType can be float vec2 vec3 or vec4. There are no prototypes in mix() for genUType, which uvec4 is part of.

Hope this helps,

Thanks,

Tony.

View solution in original post

2 Replies

Hi Alex,

Try changing uvec4 to vec4. The documentation for mix is here:

https://www.opengl.org/sdk/docs/man/html/mix.xhtml

According to the OpenGL documentation, genType can be float vec2 vec3 or vec4. There are no prototypes in mix() for genUType, which uvec4 is part of.

Hope this helps,

Thanks,

Tony.

Thanks Tony.

Ok, missed that. It is also in the QuickRef Card. Tu is for unsigned types.

I was a bit tunnel visioned, because for relational functions, T also means Tu...

Alex

0 Likes