Jump to content
  • Advertisement
Sign in to follow this  
nehonH

GLSL compilation issue on mac os x

This topic is 3031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone,

I have a vertex shader where I declare a vec4 array as varying

here is a code snippet :

varying vec4 projCoord[8];

...

void main(){

...

projCoord[0] = biasMat * m_LightViewProjectionMatrix0 * worldPos;
projCoord[1] = biasMat * m_LightViewProjectionMatrix1 * worldPos;
projCoord[2] = biasMat * m_LightViewProjectionMatrix2 * worldPos;
projCoord[3] = biasMat * m_LightViewProjectionMatrix3 * worldPos;
projCoord[4] = biasMat * m_LightViewProjectionMatrix4 * worldPos;
projCoord[5] = biasMat * m_LightViewProjectionMatrix5 * worldPos;
projCoord[6] = biasMat * m_LightViewProjectionMatrix6 * worldPos;
projCoord[7] = biasMat * m_LightViewProjectionMatrix7 * worldPos;

}

This woks fine on Windows with ATI or Nvidia cards, but on Mac OS i have this compilation error :

ERROR: 0:36: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:38: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:40: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:42: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:44: '[' : vector field selection out of range '4'
ERROR: 0:44: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:46: '[' : vector field selection out of range '5'
ERROR: 0:46: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:48: '[' : vector field selection out of range '6'
ERROR: 0:48: 'assign' : cannot convert from '4-component vector of float' to 'float'
ERROR: 0:50: '[' : vector field selection out of range '7'
ERROR: 0:50: 'assign' : cannot convert from '4-component vector of float' to 'float'

It seems that the compiler is considering projCoord as a single vec4 and not an array of vec4

As anyone bumped into a similar problem?
Or maybe i'm doing something wrong?

Here are the complete system spec on which the error appears :
MacBook Pro Core i7 with a NVIDIA GeForce GT 330M Card, MacOSX 10.6.4 with the latest driver patch (Graphics Update 1.0 for Snow Leopard) from Apple installed.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!