Title: [284849] trunk
Revision
284849
Author
[email protected]
Date
2021-10-25 16:41:45 -0700 (Mon, 25 Oct 2021)

Log Message

REGRESSION (iOS 15), safari604.1: Could not link the shader program
https://bugs.webkit.org/show_bug.cgi?id=231475

Renaming regex incorrectly substituted an attribute.
Update to require exact attribute match

Source/ThirdParty/ANGLE:

Reviewed by Dean Jackson

* src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm:
(rx::mtl::updateShaderAttributes):

LayoutTests:

Add test to expose bug, verify test passes

Reviewed by Dean Jackson.

* fast/canvas/webgl/attrib-name-aliasing-bug-expected.txt: Added.
* fast/canvas/webgl/attrib-name-aliasing-bug.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (284848 => 284849)


--- trunk/LayoutTests/ChangeLog	2021-10-25 23:39:50 UTC (rev 284848)
+++ trunk/LayoutTests/ChangeLog	2021-10-25 23:41:45 UTC (rev 284849)
@@ -1,3 +1,18 @@
+2021-10-25  Kyle Piddington  <[email protected]>
+
+        REGRESSION (iOS 15), safari604.1: Could not link the shader program
+        https://bugs.webkit.org/show_bug.cgi?id=231475
+
+        Renaming regex incorrectly substituted an attribute. 
+        Update to require exact attribute match
+
+        Add test to expose bug, verify test passes
+
+        Reviewed by Dean Jackson.
+
+        * fast/canvas/webgl/attrib-name-aliasing-bug-expected.txt: Added.
+        * fast/canvas/webgl/attrib-name-aliasing-bug.html: Added.
+
 2021-10-25  John Wilander  <[email protected]>
 
         Remove assert failure expectations after r284846 landed

Added: trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug-expected.txt (0 => 284849)


--- trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug-expected.txt	2021-10-25 23:41:45 UTC (rev 284849)
@@ -0,0 +1,10 @@
+Verify fix on substring-mached attrib locations.
+Test attrib names not incorrectly identified during renaming
+PASS gl.getProgramParameter(program, gl.LINK_STATUS) is true
+PASS attrib location should not be -1
+PASS attrib 2 location should not be -1
+PASS getError was expected value: NO_ERROR :
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug.html (0 => 284849)


--- trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/attrib-name-aliasing-bug.html	2021-10-25 23:41:45 UTC (rev 284849)
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL attrib location length tests</title>
+<script src=""
+<script src="" </script>
+<script src="" </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description">Verify fix on substring-mached attrib locations.</div>
+<div id="console"></div>
+<script id="vertexShader" type="x-shader/x-vertex">
+// A shader where two attributes share the same substring.
+attribute vec4 attrib_name;
+attribute vec4 name;
+
+void main()
+{
+    gl_Position = attrib_name + name;
+}
+</script>
+<script id="fragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+if (window.initNonKhronosFramework) {
+    window.initNonKhronosFramework(false);
+}
+if (window.internals)
+    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext(document.getElementById("example"));
+
+debug("Test attrib names not incorrectly identified during renaming");
+var program = wtu.loadProgramFromScript(gl, "vertexShader", "fragmentShader");
+shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
+var attribLoc = gl.getAttribLocation(program, "attrib_name");
+var attribLoc2 = gl.getAttribLocation(program, "name");
+if (attribLoc == -1) {
+    testFailed("attrib location was -1, should not be");
+} else {
+    testPassed("attrib location should not be -1");
+}
+if (attribLoc2 == -1) {
+    testFailed("attrib 2 location was -1, should not be");
+} else {
+    testPassed("attrib 2 location should not be -1");
+}
+wtu.glErrorShouldBe(gl, gl.NONE);
+
+
+</script>
+</body>
+</html>

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (284848 => 284849)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-10-25 23:39:50 UTC (rev 284848)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-10-25 23:41:45 UTC (rev 284849)
@@ -1,3 +1,16 @@
+2021-10-25  Kyle Piddington  <[email protected]>
+
+        REGRESSION (iOS 15), safari604.1: Could not link the shader program
+        https://bugs.webkit.org/show_bug.cgi?id=231475
+
+        Renaming regex incorrectly substituted an attribute. 
+        Update to require exact attribute match
+
+        Reviewed by Dean Jackson
+
+        * src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm:
+        (rx::mtl::updateShaderAttributes):
+
 2021-10-15  Ross Kirsling  <[email protected]>
 
         Realize Mac CMake build of WebCore and WebKit

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm (284848 => 284849)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm	2021-10-25 23:39:50 UTC (rev 284848)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm	2021-10-25 23:41:45 UTC (rev 284849)
@@ -171,15 +171,16 @@
             for(int i = 0; i < regs; i++)
             {
                 stream.str("");
-                stream << attribute.name << "_" << std::to_string(i) << sh::kUnassignedAttributeString;
-                attributeBindings.insert({std::string(stream.str()), i+attribute.location});
+                stream << " " << kUserDefinedNamePrefix << attribute.name << "_" << std::to_string(i)
+                                       << sh::kUnassignedAttributeString;
+                attributeBindings.insert({std::string(stream.str()), i + attribute.location});
             }
         }
         else
         {
             stream.str("");
-            stream << attribute.name << sh::kUnassignedAttributeString;
-            attributeBindings.insert({std::string(stream.str()),attribute.location});
+            stream << " " << kUserDefinedNamePrefix << attribute.name << sh::kUnassignedAttributeString;
+            attributeBindings.insert({std::string(stream.str()), attribute.location});
         }
     }
     //Rewrite attributes
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to