Fix timeline shaders for OpenGL ES

In OpenGL ES you have to:
* Specify the precision for most values in fragment shaders
* Add a special declaration to use fwidth()
* Make sure both values passed to max() are of the same type
  (this may be the case for some Desktop OpenGL implementations, too)

Repeating the default precision (highp float) in vertex shaders is useless
and might lead to type casting problems, so we drop it.

Without this change, the timeline doesn't work on Windows with ANGLE.

Change-Id: I69a1976eddb6f4dc6dfe5fe9f270839432088cbb
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-03-18 18:07:57 +01:00
committed by Ulf Hermann
parent bc6893773f
commit a2a5536822
4 changed files with 16 additions and 11 deletions

View File

@@ -28,7 +28,7 @@
**
****************************************************************************/
vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
lowp vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
void main()
{
gl_FragColor = orange;