Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: JeGX on May 15, 2014, 03:13:05 PM

Title: GLSL compiler: NVIDIA vs AMD vs Intel
Post by: JeGX on May 15, 2014, 03:13:05 PM
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);

Title: GLSL compiler: NVIDIA vs AMD vs Intel (02)
Post by: JeGX on November 16, 2014, 12:11:28 PM
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:
Quote
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!