[NVIDIA 190.18.04 (64)] crash in glCompileShader

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.


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 .

Thanks for the precision :wink:
Actually only the vertex shader seem to crash, and with a semi colon at the end of interface definition no more crash …

The crash is always present in 190.32, with core and compatibility glx context.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.