frigopie
05-18-2011, 09:10 PM
Hi!
I have a little (big) problem initializing const arrays. On ATI cards only works this way:
const float vec[3]=vec[3](1.0,2.0,3.0); //Works :)
but in my Nvidia card this way only works with arrays bigger than 1 (stupid and strange, isīn it?), so:
const float vec[3]=vec[3](1.0,2.0,3.0); //It is fine
const float vec[1]=vec[1](1.0); //Fails! cast not allowed error
There is another C like way used in nvidia cg shaders that works on my nvidia card but not in on ATI, so it is unuseful.
Is there any standard way to init const arrays that works on all cards?
PD: I need const arrays with values known at compilation time, not uniforms, because of compiler optimizations
Thanks!
I have a little (big) problem initializing const arrays. On ATI cards only works this way:
const float vec[3]=vec[3](1.0,2.0,3.0); //Works :)
but in my Nvidia card this way only works with arrays bigger than 1 (stupid and strange, isīn it?), so:
const float vec[3]=vec[3](1.0,2.0,3.0); //It is fine
const float vec[1]=vec[1](1.0); //Fails! cast not allowed error
There is another C like way used in nvidia cg shaders that works on my nvidia card but not in on ATI, so it is unuseful.
Is there any standard way to init const arrays that works on all cards?
PD: I need const arrays with values known at compilation time, not uniforms, because of compiler optimizations
Thanks!