GLSL compiler: NVIDIA vs AMD vs Intel

Started by JeGX, May 15, 2014, 03:13:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Here is a thread where I store issues I encounter with NVIDIA, AMD and Intel GLSL compilers.

The following GLSL line is accepted by NVIDIA compiler (R337.50) but generates an error with Intel and AMD compilers:

  vec3 tc = vec4(0);

Of course the right line is

  vec3 tc = vec3(0);


In a recent shader, I wrote this line:

float lum =  T * vec4(0.21, 0.72, 0.07, 0);

where T is a vec4.

This line works perfectly on NVIDIA GLSL compiler but generates an error on AMD compiler:
ERROR: 0:78: '=' :  cannot convert from '4-component vector of float' to 'float' 

The error produced by AMD GLSL compiler is correct and NVIDIA should do the same thing.  Weirdly, the shader works properly and the rendering was  the one expected on NVIDIA GPUs.

The right code is:

float lum =  dot(T, vec4(0.21, 0.72, 0.07, 0));

which is ok on all graphics hardware!