Changeset 189331 in webkit


Ignore:
Timestamp:
Sep 3, 2015 7:08:24 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

[Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
https://bugs.webkit.org/show_bug.cgi?id=143993

Patch by Jinyoung Hur <hur.ims@navercorp.com> on 2015-09-03
Reviewed by Martin Robinson.

There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
GL_FRAGMENT_PRECISION_HIGH.
Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
GL_OES_fragment_precision_high extension.

No new tests, covered by existing tests.

  • platform/graphics/texmap/TextureMapperShaderProgram.cpp:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r189327 r189331  
     12015-09-03  Jinyoung Hur  <hur.ims@navercorp.com>
     2
     3        [Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
     4        https://bugs.webkit.org/show_bug.cgi?id=143993
     5
     6        Reviewed by Martin Robinson.
     7
     8        There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
     9        Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
     10        GL_FRAGMENT_PRECISION_HIGH.
     11        Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
     12        GL_OES_fragment_precision_high extension.
     13
     14        No new tests, covered by existing tests.
     15
     16        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
     17
    1182015-09-03  Ryosuke Niwa  <rniwa@webkit.org>
    219
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp

    r174830 r189331  
    120120
    121121#define GLSL_DIRECTIVE(...) "#"#__VA_ARGS__"\n"
     122
     123#define TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE \
     124    GLSL_DIRECTIVE(ifdef GL_FRAGMENT_PRECISION_HIGH) \
     125        GLSL_DIRECTIVE(define TextureSpaceMatrixPrecision highp) \
     126    GLSL_DIRECTIVE(else) \
     127        GLSL_DIRECTIVE(define TextureSpaceMatrixPrecision mediump) \
     128    GLSL_DIRECTIVE(endif)
     129
    122130static const char* vertexTemplate =
     131    TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
    123132    STRINGIFY(
     133        precision TextureSpaceMatrixPrecision float;
    124134        attribute vec4 a_vertex;
    125135        uniform mat4 u_modelViewMatrix;
     
    208218    ANTIALIASING_TEX_COORD_DIRECTIVE
    209219    BLUR_CONSTANTS
     220    TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
    210221    STRINGIFY(
    211         precision highp float;
     222        precision TextureSpaceMatrixPrecision float;
    212223        uniform mat4 u_textureSpaceMatrix;
    213224        precision mediump float;
Note: See TracChangeset for help on using the changeset viewer.