Title: [225800] trunk/Source/WebCore
Revision
225800
Author
[email protected]
Date
2017-12-12 13:11:11 -0800 (Tue, 12 Dec 2017)

Log Message

WebGL TextureMapperShaderProgram shaders don't compile in MSVC
https://bugs.webkit.org/show_bug.cgi?id=180709

Patch by Christopher Reid <[email protected]> on 2017-12-12
Reviewed by Myles C. Maxfield.

No new tests, no change in behavior.

Vertex and Fragment shaders were not compiling because TextureMapperShaderProgram.cpp was
stringifying "#if USE(OPENGL_ES_2) ... #endif" into the shaders rather than evaluating these
preprocessor directives before the STRINGIFY expansion.

Moved these #if conditions outside of STRINGIFY to remove compiler ambiguity.

* platform/graphics/texmap/TextureMapperShaderProgram.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225799 => 225800)


--- trunk/Source/WebCore/ChangeLog	2017-12-12 21:01:57 UTC (rev 225799)
+++ trunk/Source/WebCore/ChangeLog	2017-12-12 21:11:11 UTC (rev 225800)
@@ -1,3 +1,20 @@
+2017-12-12  Christopher Reid  <[email protected]>
+
+        WebGL TextureMapperShaderProgram shaders don't compile in MSVC
+        https://bugs.webkit.org/show_bug.cgi?id=180709
+
+        Reviewed by Myles C. Maxfield.
+
+        No new tests, no change in behavior.
+
+        Vertex and Fragment shaders were not compiling because TextureMapperShaderProgram.cpp was
+        stringifying "#if USE(OPENGL_ES_2) ... #endif" into the shaders rather than evaluating these
+        preprocessor directives before the STRINGIFY expansion.
+
+        Moved these #if conditions outside of STRINGIFY to remove compiler ambiguity.
+
+        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
+
 2017-12-12  Zach Li  <[email protected]>
         [WK2] Expose image via WKBundleHitTestResult API.
         https://bugs.webkit.org/show_bug.cgi?id=180552.

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (225799 => 225800)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2017-12-12 21:01:57 UTC (rev 225799)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2017-12-12 21:11:11 UTC (rev 225800)
@@ -58,10 +58,12 @@
 #if USE(OPENGL_ES_2)
     TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
 #endif
+#if USE(OPENGL_ES_2)
     STRINGIFY(
-#if USE(OPENGL_ES_2)
         precision TextureSpaceMatrixPrecision float;
+    )
 #endif
+    STRINGIFY(
         attribute vec4 a_vertex;
         varying vec2 v_texCoord;
         varying vec2 v_transformedTexCoord;
@@ -168,16 +170,21 @@
 #if USE(OPENGL_ES_2)
     TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
 #endif
+#if USE(OPENGL_ES_2)
     STRINGIFY(
-#if USE(OPENGL_ES_2)
         precision TextureSpaceMatrixPrecision float;
+    )
 #endif
+    STRINGIFY(
         uniform mat4 u_textureSpaceMatrix;
         uniform mat4 u_textureColorSpaceMatrix;
+    )
 #if USE(OPENGL_ES_2)
+    STRINGIFY(
         precision mediump float;
+    )
 #endif
-    );
+    ;
 
 // Input/output variables definition for both GLES and OpenGL < 3.2.
 static const char* fragmentTemplateLT320Vars =
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to