Bug 117705 - Shader compiler not properly configured for GLES on cairo based ports
Summary: Shader compiler not properly configured for GLES on cairo based ports
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
: 117804 (view as bug list)
Depends on:
Reported: 2013-06-17 09:44 PDT by Mario Sanchez Prada
Modified: 2013-10-30 10:51 PDT (History)
5 users (show)

See Also:

Patch proposal (2.35 KB, patch)
2013-06-17 09:48 PDT, Mario Sanchez Prada
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2013-06-17 09:44:12 PDT
At the moment, the ANGLE shader compiler used in GraphicsContext3D for cairo based ports is always speaking GLSL, no matter WebKit is configured to use a GLES2 or an GL backend. This is causing some problems such as that the "precision mediump float;" bit in the fragment shader template used by TextureMapper(see TextureMapperShaderProgram.cpp) gets ignored when compiled by ANGLE, causing problems with some graphics drivers because that will mean that float precision for fragment shaders won't be explicitly specified, which seems to be a requirement for GLES2 (even if some implementations are more relaxed about it).

The solution seems to be as simple as properly configuring the ANGLE compiler when creating the graphics context, to use SH_ESSL_OUTPUT instead of SH_GLSL_OUTPUT when GLES2 is used.
Comment 1 Mario Sanchez Prada 2013-06-17 09:48:05 PDT
Created attachment 204829 [details]
Patch proposal

Here comes the patch. It addresses the issue in a similar fashion to the Qt and EFL ports, and also clearly fixes an obscure issue for us as well, so I hope it'll be the right one.

Now kindly asking for review...
Comment 2 Mario Sanchez Prada 2013-06-18 01:35:43 PDT
Committed r151676: <http://trac.webkit.org/changeset/151676>
Comment 3 Cidorvan Leite 2013-10-30 10:51:00 PDT
*** Bug 117804 has been marked as a duplicate of this bug. ***