summaryrefslogtreecommitdiff
path: root/slideshow/opengl/vortexVertexShader.glsl
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>2016-02-24 20:21:12 +0000
committerTomaž Vajngerl <quikee@gmail.com>2016-02-25 11:12:50 +0000
commitdb9fe1ea4a1e0e33dece63652c2b076fb323ec63 (patch)
tree1aa4b9cb2022d829b671855e8065a7c2b4722385 /slideshow/opengl/vortexVertexShader.glsl
parent06404309026b8e5aeb4c47ea68aea7ef21c6654e (diff)
slideshow: Add an ugly workaround for Intel’s matrix multiplication
When more than three multiplications are chained, Intel’s Windows driver returns a mat4 containing only zeroes, likely due to a misbehaving optimisation. This patch prevents it from doing any optimisation by doing each multiplication in its own uniform block. Change-Id: I0b435d3a5444afd47f78c379f0d2e442d2c2cfc0 Reviewed-on: https://gerrit.libreoffice.org/22470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'slideshow/opengl/vortexVertexShader.glsl')
-rw-r--r--slideshow/opengl/vortexVertexShader.glsl15
1 files changed, 11 insertions, 4 deletions
diff --git a/slideshow/opengl/vortexVertexShader.glsl b/slideshow/opengl/vortexVertexShader.glsl
index 3d5838e5b9b3..5c6fe23a3f15 100644
--- a/slideshow/opengl/vortexVertexShader.glsl
+++ b/slideshow/opengl/vortexVertexShader.glsl
@@ -26,6 +26,9 @@ uniform ivec2 numTiles;
uniform sampler2D permTexture;
uniform float slide;
+// Workaround for Intel's Windows driver, to prevent optimisation breakage.
+uniform float zero;
+
out vec2 g_texturePosition;
out vec3 g_normal;
out mat4 modelViewMatrix;
@@ -130,10 +133,14 @@ void main( void )
vec3 translationVector = vec3(rotationFuzz, 0.0, 0.0);
// Compute the actual rotation matrix.
- transform = translationMatrix(translationVector)
- * rotationMatrix(vec3(0.0, 1.0, 0.0), clamp(rotation, -1.0, 1.0) * M_PI)
- * translationMatrix(-translationVector)
- * transform;
+
+ // Intel's Windows driver gives a wrong matrix when all operations are done at once.
+ if (zero < 1.0)
+ transform = translationMatrix(translationVector) * transform;
+ if (zero < 2.0)
+ transform = rotationMatrix(vec3(0.0, 1.0, 0.0), clamp(rotation, -1.0, 1.0) * M_PI) * transform;
+ if (zero < 3.0)
+ transform = translationMatrix(-translationVector) * transform;
}
modelViewMatrix = u_modelViewMatrix * u_operationsTransformMatrix * u_sceneTransformMatrix * u_primitiveTransformMatrix;