Changeset 269040 in webkit


Ignore:
Timestamp:
Oct 27, 2020 8:34:01 AM (3 years ago)
Author:
magomez@igalia.com
Message:

[WPE] REGRESSION(r268992) Redefinition of min() inside TextureMapperShaderProgram for GLES > 3.0
https://bugs.webkit.org/show_bug.cgi?id=218231

Reviewed by Sergio Villar Senin.

Remove the definition of the min() function and replace its usage with an if. This works for
every GLSL version.

  • platform/graphics/texmap/TextureMapperShaderProgram.cpp:

(WebCore::TextureMapperShaderProgram::create):
(WebCore::STRINGIFY): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269039 r269040  
     12020-10-27  Miguel Gomez  <magomez@igalia.com>
     2
     3        [WPE] REGRESSION(r268992) Redefinition of min() inside TextureMapperShaderProgram for GLES > 3.0
     4        https://bugs.webkit.org/show_bug.cgi?id=218231
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Remove the definition of the min() function and replace its usage with an if. This works for
     9        every GLSL version.
     10
     11        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
     12        (WebCore::TextureMapperShaderProgram::create):
     13        (WebCore::STRINGIFY): Deleted.
     14
    1152020-10-27  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp

    r268992 r269040  
    225225        in vec2 v_transformedTexCoord;
    226226        in vec4 v_nonProjectedPosition;
    227     );
    228 #else
    229 // min(genIType) isn't supported for GLSL ES < 3.0.
    230 static const char* fragmentTemplateES =
    231     STRINGIFY(
    232         int min(int x, int y)
    233         {
    234             if (x < y)
    235                 return x;
    236             return y;
    237         }
    238227    );
    239228#endif
     
    478467            // and the projection screws the Z component. We need the real 3D position that comes from
    479468            // the nonProjectedPosition variable.
    480             int nRects = min(ROUNDED_RECT_MAX_RECTS, u_roundedRectNumber);
     469            int nRects = u_roundedRectNumber;
     470            if (nRects > ROUNDED_RECT_MAX_RECTS)
     471                nRects = ROUNDED_RECT_MAX_RECTS;
     472
    481473            for (int rectIndex = 0; rectIndex < nRects; rectIndex++) {
    482474                vec4 fragCoord = u_roundedRectInverseTransformMatrix[rectIndex] * v_nonProjectedPosition;
     
    588580#if USE(OPENGL_ES)
    589581    fragmentShaderBuilder.append(fragmentTemplateLT320Vars);
    590     fragmentShaderBuilder.append(fragmentTemplateES);
    591582#else
    592583    if (glVersion >= 320)
Note: See TracChangeset for help on using the changeset viewer.