Title: [278898] trunk/Source/ThirdParty/ANGLE
Revision
278898
Author
kpidding...@apple.com
Date
2021-06-15 14:02:52 -0700 (Tue, 15 Jun 2021)

Log Message

Tensorflow.js Broken in Safari 15
https://bugs.webkit.org/show_bug.cgi?id=226953

Tensorflow shaders use a 'NAN' uniform. This is a reserved keyword
in metal. Add NAN to the reserved list.

'inf' constants need to be replaced with INFINITY, much like nan constants need to be replaced with NAN
Reviewed by Kenneth Russell.

* src/compiler/translator/TranslatorMetalDirect.cpp:
(sh::GetMslKeywords):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (278897 => 278898)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-06-15 20:57:31 UTC (rev 278897)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-06-15 21:02:52 UTC (rev 278898)
@@ -1,3 +1,17 @@
+2021-06-15  Kyle Piddington  <kpidding...@apple.com>
+
+        Tensorflow.js Broken in Safari 15
+        https://bugs.webkit.org/show_bug.cgi?id=226953
+
+        Tensorflow shaders use a 'NAN' uniform. This is a reserved keyword
+        in metal. Add NAN to the reserved list.
+
+        'inf' constants need to be replaced with INFINITY, much like nan constants need to be replaced with NAN
+        Reviewed by Kenneth Russell.
+
+        * src/compiler/translator/TranslatorMetalDirect.cpp:
+        (sh::GetMslKeywords):
+
 2021-06-15  Alex Christensen  <achristen...@webkit.org>
 
         Fix typo in r276318

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp (278897 => 278898)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp	2021-06-15 20:57:31 UTC (rev 278897)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp	2021-06-15 21:02:52 UTC (rev 278898)
@@ -1498,6 +1498,17 @@
             {
                 mOut << "NAN";
             }
+            if (ANGLE_UNLIKELY(isinf(constUnion->getFConst())))
+            {
+                if(constUnion->getFConst() < 0)
+                {
+                    mOut << "-INFINITY";
+                }
+                else
+                {
+                    mOut << "INFINITY";
+                }
+            }
             else
             {
                 mOut << constUnion->getFConst() << "f";

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect.cpp (278897 => 278898)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect.cpp	2021-06-15 20:57:31 UTC (rev 278897)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect.cpp	2021-06-15 21:02:52 UTC (rev 278898)
@@ -906,7 +906,7 @@
     keywords.emplace("virtual");
     keywords.emplace("volatile");
     keywords.emplace("wchar_t");
-
+    keywords.emplace("NAN");
     return keywords;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to