PDA

View Full Version : [NVIDIA 190.18.04 (64)] crash in glCompileShader



matrem
08-31-2009, 11:49 PM
Hi,

I hope nvidia guys are reading this forum, because I've experienced a crash in glCompileShader, will testing interface blocks.
Perhaps my shader (vertex and fragment, no geometry) are not correct, but I expect some error message ;).

Here they are :

#version 150 core

in vec3 position;
in vec3 normal;

uniform transform
{
mat4 projection;
mat4 view;
mat4 model;
}

out lighting
{
vec3 N;
vec3 L;
vec3 V;
}

uniform vec3 lightDir;

void main()
{
mat3 normalMatrix = mat3(view * model);

vec3 pos = vec3(view * model * vec4(position, 1.));

N = normalize(normalMatrix * normal);
L = mat3(view) * -lightDir;
V = -pos;

gl_Position = projection * view * model * vec4(position, 1.);
}


#version 150 core

in lighting
{
vec3 N;
vec3 L;
vec3 V;
} lighting;

const vec3 ambient = vec3(0.1);
const float shininess = 100.;

void main()
{
vec3 L = normalize(lighting.L);
vec3 V = normalize(lighting.V);
vec3 N = normalize(lighting.N);
vec3 R = reflect(-L, N);

float diffuse = max(dot(L, N), 0.);
float specular = max(pow(dot(normalize(V), R), shininess), 0.);

vec3 color = vec3(diffuse + specular);

gl_FragColor = vec4(ambient + color, 1.);
}

Thanks.

ps:
I'm under ubuntu 9.04 2.6.28-15-generic 64 bits kernel, with a gf9800gt.

Groovounet
09-01-2009, 05:43 AM
in lighting
{
vec3 N;
vec3 L;
vec3 V;
} lighting;


This part of your code seams quite odd to me. But of course you should not get a crash but an error log for that.

Change "in lighting" by "in Lighting" and it will works normally. You need to change the name in the C++ code as well where you look for the block location .

matrem
09-01-2009, 03:32 PM
Thanks for the precision ;)
Actually only the vertex shader seem to crash, and with a semi colon at the end of interface definition no more crash ...

matrem
09-13-2009, 08:54 AM
The crash is always present in 190.32, with core and compatibility glx context.