changeset 7418:5343b3c3f733

Fix to RT-37789: Embedded, 3D: Rendering artifacts on the Freescale iMX6 device Reviewed by kcr.
author Chien Yang <chien.yang@oracle.com>
date Thu, 03 Jul 2014 13:38:35 -0700
parents ea458832eefc
children b205d3c0b524
files modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main.vert
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main.vert	Fri Jul 04 00:23:46 2014 +0400
+++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main.vert	Thu Jul 03 13:38:35 2014 -0700
@@ -54,9 +54,15 @@
 
     vec4 worldPos = worldMatrix * vec4(pos, 1.0);
 
-    vec3 t1 = tangent.xyz * tangent.yzx *2.0;
-    vec3 t2 = tangent.zxy * tangent.www *2.0;
-    vec3 t3 = tangent.xyz * tangent.xyz *2.0;
+    // Note: The breaking of a vector and scale computation statement into
+    //       2 separate statements is intentional to workaround a shader
+    //       compiler bug on the Freescale iMX6 platform. See RT-37789 for details. 
+    vec3 t1 = tangent.xyz * tangent.yzx;
+         t1 *= 2.0;
+    vec3 t2 = tangent.zxy * tangent.www;
+         t2 *= 2.0;
+    vec3 t3 = tangent.xyz * tangent.xyz;
+         t3 *= 2.0;
     vec3 t4 = 1.0-(t3+t3.yzx);
 
     vec3 r1 = t1 + t2;
@@ -89,7 +95,7 @@
     L = lights[2].pos.xyz - worldPos.xyz;
     lightTangentSpacePositions[2] = vec4( getLocalVector(L,tangentFrame)*lights[2].pos.w, 1.0);
 
-    mat4 mvpMatrix = viewProjectionMatrix * worldMatrix;
+     mat4 mvpMatrix = viewProjectionMatrix * worldMatrix;
 
     //Send texcoords to Pixel Shader and calculate vertex position.
     oTexCoords = texCoords;