Author Topic: GLSL compiler: NVIDIA vs AMD vs Intel  (Read 6080 times)

0 Members and 1 Guest are viewing this topic.

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2079
    • View Profile
    • Geeks3D.com
GLSL compiler: NVIDIA vs AMD vs Intel
« 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:
Code: [Select]
  vec3 tc = vec4(0);

Of course the right line is
Code: [Select]
  vec3 tc = vec3(0);
« Last Edit: May 15, 2014, 03:24:49 PM by JeGX »


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2079
    • View Profile
    • Geeks3D.com
GLSL compiler: NVIDIA vs AMD vs Intel (02)
« Reply #1 on: November 16, 2014, 12:11:28 PM »
In a recent shader, I wrote this line:
Code: [Select]
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:
Code: [Select]
float lum =  dot(T, vec4(0.21, 0.72, 0.07, 0));

which is ok on all graphics hardware!