[Libreoffice-commits] core.git: Branch 'feature/fixes17' - slideshow/opengl

Emmanuel Gil Peyrot emmanuel.peyrot at collabora.com
Thu Feb 25 19:32:09 UTC 2016


 slideshow/opengl/vortexGeometryShader.glsl |   22 ++++++++++++++++++----
 slideshow/opengl/vortexVertexShader.glsl   |   14 --------------
 2 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit bb14be25bdb139410cdbe5627de08d1625b8e6fa
Author: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>
Date:   Wed Feb 24 20:21:11 2016 +0000

    slideshow: Move Vortex calculations to the geometry stage, fixes Intel
    
    Their Windows driver was failing due to too many varyings being used
    between the vertex and the geometry stages.
    
    Change-Id: Iec69a2ef29e6ed4ba5ce6e46c7a5eb7db5098d1b

diff --git a/slideshow/opengl/vortexGeometryShader.glsl b/slideshow/opengl/vortexGeometryShader.glsl
index 312baba..5d64a12 100644
--- a/slideshow/opengl/vortexGeometryShader.glsl
+++ b/slideshow/opengl/vortexGeometryShader.glsl
@@ -12,11 +12,14 @@
 layout(triangles) in;
 layout(triangle_strip, max_vertices=11) out;
 
+uniform float shadow;
+uniform mat4 u_projectionMatrix;
+uniform mat4 orthoProjectionMatrix;
+uniform mat4 orthoViewMatrix;
+
 in vec2 g_texturePosition[];
 in vec3 g_normal[];
-in mat4 projectionMatrix[];
 in mat4 modelViewMatrix[];
-in mat4 shadowMatrix[];
 in mat4 transform[];
 in float nTime[];
 in float startTime[];
@@ -52,6 +55,17 @@ mat4 translationMatrix(vec3 axis)
 
 void emitHexagonVertex(int index, vec3 translation, float fdsq)
 {
+    mat4 projectionMatrix;
+    mat4 shadowMatrix;
+
+    if (shadow < 0.5) {
+        projectionMatrix = u_projectionMatrix;
+        shadowMatrix = orthoProjectionMatrix * orthoViewMatrix;
+    } else {
+        projectionMatrix = orthoProjectionMatrix * orthoViewMatrix;
+        shadowMatrix = mat4(0.0);
+    }
+
     mat4 normalMatrix = transpose(inverse(modelViewMatrix[index]));
 
     vec4 pos = gl_in[index].gl_Position + vec4(translation, 0.0);
@@ -62,8 +76,8 @@ void emitHexagonVertex(int index, vec3 translation, float fdsq)
     v_normal = normalize(vec3(normalMatrix * transform[index] * vec4(g_normal[index], 0.0)));
     v_normal.z *= fdsq;
 
-    gl_Position = projectionMatrix[index] * modelViewMatrix[index] * pos;
-    shadowCoordinate = translationMatrix(vec3(0.5, 0.5, 0.5)) * scaleMatrix(vec3(0.5, 0.5, 0.5)) * shadowMatrix[index] * modelViewMatrix[index] * pos;
+    gl_Position = projectionMatrix * modelViewMatrix[index] * pos;
+    shadowCoordinate = translationMatrix(vec3(0.5, 0.5, 0.5)) * scaleMatrix(vec3(0.5, 0.5, 0.5)) * shadowMatrix * modelViewMatrix[index] * pos;
     v_texturePosition = g_texturePosition[index];
     EmitVertex();
 }
diff --git a/slideshow/opengl/vortexVertexShader.glsl b/slideshow/opengl/vortexVertexShader.glsl
index 9bab2d9..3d5838e 100755
--- a/slideshow/opengl/vortexVertexShader.glsl
+++ b/slideshow/opengl/vortexVertexShader.glsl
@@ -16,7 +16,6 @@ in vec3 a_normal;
 in vec2 a_texCoord;
 in float tileInfo;
 
-uniform mat4 u_projectionMatrix;
 uniform mat4 u_modelViewMatrix;
 uniform mat4 u_sceneTransformMatrix;
 uniform mat4 u_primitiveTransformMatrix;
@@ -26,15 +25,10 @@ uniform float time;
 uniform ivec2 numTiles;
 uniform sampler2D permTexture;
 uniform float slide;
-uniform float shadow;
-uniform mat4 orthoProjectionMatrix;
-uniform mat4 orthoViewMatrix;
 
 out vec2 g_texturePosition;
 out vec3 g_normal;
-out mat4 projectionMatrix;
 out mat4 modelViewMatrix;
-out mat4 shadowMatrix;
 out mat4 transform;
 out float nTime;
 out float startTime;
@@ -142,14 +136,6 @@ void main( void )
                   * transform;
     }
 
-    if (shadow < 0.5) {
-        projectionMatrix = u_projectionMatrix;
-        shadowMatrix = orthoProjectionMatrix * orthoViewMatrix;
-    } else {
-        projectionMatrix = orthoProjectionMatrix * orthoViewMatrix;
-        shadowMatrix = mat4(0.0);
-    }
-
     modelViewMatrix = u_modelViewMatrix * u_operationsTransformMatrix * u_sceneTransformMatrix * u_primitiveTransformMatrix;
     gl_Position = vec4(a_position, 1.0);
 


More information about the Libreoffice-commits mailing list