gl_NormalMatrix, defined at line 84 of slang_builtin.c, in lookup_statevar() is not defined correctly. The definition: { "gl_NormalMatrix", STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE }, is same as for gl_ModelViewMatrix. However, the normal matrix is equal to the 3x3 top-left submatrix of the modelview matrix only if the modelview matrix is orthogonal (i.e. its columns have length equal to 1.0). If the modelviewmatrix is not orthogonal (i.e. scaling is applied), this does not hold. The normal matrix should be computed as the inverse transpose of the top-left 3x3 submatrix of the modelview matrix, as described in section 2.11.3 of the OpenGL 2.1 specification.
Mass version move, cvs -> git
From the looks of the code, this appears to be fixed (uniform.c): static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = { { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE}, SWIZZLE_XYZW }, { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE}, SWIZZLE_XYZW }, { NULL, { STATE_MODELVIEW_MATRIX, 0, 2, 2, STATE_MATRIX_INVERSE}, SWIZZLE_XYZW }, }; Closing. Feel free to reopen if you still have issues.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.