View Single Post
Old 06-13-10, 04:13 PM   #1
emeiri
Registered User
 
Join Date: Mar 2008
Posts: 5
Default OpenGL app crashing with driver 195.36.31

Hi,

My OpenGL app is crashing with driver 195.36.31. The screen starts blinking and then the app crashes.

Machine details:
OS: 64 bit Ubuntu 10.04
Kernel: 2.6.32-22
GFX: 8500GT

Here's the core of my render function:

struct Vertex
{
Vector3f pos;
Vector3f tangent;
Vector3f normal;
Vector2f texC;
};

Vector3f and Vector2f are simply structs of 3 and 2 floats, respectively.

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_INDEX_ARRAY);
glEnableVertexAttribArray(m_tangentLoc);

glVertexPointer(3, GL_FLOAT, sizeof(Vertex), 0);
glVertexAttribPointer(m_tangentLoc, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)sizeof(Vector3f));
glNormalPointer(GL_FLOAT, sizeof(Vertex), (GLvoid*)(sizeof(Vector3f) * 2));
glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), (GLvoid*)(sizeof(Vector3f) * 3));
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_SHORT, 0);

glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableVertexAttribArray(m_tangentLoc);

Note: m_tangentLoc was retrieved using glGetAttribLocation(prog, "Tangent")

Here's my vertex shader:

attribute vec3 Tangent;

varying vec3 NormalV;
varying vec3 TangentV;
varying vec3 PosV;

void main()
{
gl_Position = ftransform();

gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;

NormalV = (gl_NormalMatrix * gl_Normal).xyz;
TangentV = (gl_NormalMatrix * Tangent);
PosV = (gl_ModelViewMatrix * gl_Vertex).xyz;
}

If I comment out the line where the tangent is multiplied by the normal matrix the crash is gone.

Please let me know if you need any more details.

Thanks a lot,

Etay Meiri
emeiri is offline   Reply With Quote