Skip to content

Commit

Permalink
#5912: Fix GLSL compilation errors in Mesa driver
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 12, 2022
1 parent f07655f commit b196eb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 4 additions & 6 deletions install/gl/interaction_vp.glsl
Expand Up @@ -39,15 +39,13 @@ varying vec4 var_Colour; // colour to be multiplied on the final fragment

void main()
{
vec4 untransformedVertex = gl_Vertex;

gl_Vertex = u_objectTransform * gl_Vertex;
vec4 worldVertex = u_objectTransform * gl_Vertex;

// transform vertex position into homogenous clip-space
gl_Position = ftransform();
gl_Position = gl_ModelViewProjectionMatrix * worldVertex;

// assign position in object space
var_vertex = gl_Vertex.xyz;
var_vertex = worldVertex.xyz;

// transform texcoords into diffusemap texture space
var_tex_diffuse_bump.st = (gl_TextureMatrix[0] * attr_TexCoord0).st;
Expand All @@ -59,7 +57,7 @@ void main()
var_tex_specular = (gl_TextureMatrix[2] * attr_TexCoord0).st;

// calc light xy,z attenuation in light space
var_tex_atten_xy_z = gl_TextureMatrix[3] * untransformedVertex;
var_tex_atten_xy_z = gl_TextureMatrix[3] * gl_Vertex;

// construct object-space-to-tangent-space 3x3 matrix
var_mat_os2ts = mat3(
Expand Down
4 changes: 1 addition & 3 deletions install/gl/zfill_vp.glsl
Expand Up @@ -29,10 +29,8 @@ varying vec2 var_tex_diffuse;
void main()
{
// Apply the supplied object transform to the incoming vertex
gl_Vertex = u_objectTransform * gl_Vertex;

// transform vertex position into homogenous clip-space
gl_Position = ftransform();
gl_Position = gl_ModelViewProjectionMatrix * u_objectTransform * gl_Vertex;

// transform texcoords
var_tex_diffuse = (gl_TextureMatrix[0] * attr_TexCoord0).st;
Expand Down

0 comments on commit b196eb7

Please sign in to comment.