Title: [274990] trunk/Source/ThirdParty/ANGLE
Revision
274990
Author
[email protected]
Date
2021-03-24 18:06:18 -0700 (Wed, 24 Mar 2021)

Log Message

Metal ANGLE crashes LayoutTests/inspector/canvas/updateShader-webgl.html
	Rather than rely on an instance variable in a C++ class, just query the dictionary constant when needed.

https://bugs.webkit.org/show_bug.cgi?id=223695

Patch by Kyle Piddington <[email protected]> on 2021-03-24
Reviewed by Dean Jackson.

* src/libANGLE/renderer/metal/ProgramMtl.h:
* src/libANGLE/renderer/metal/ProgramMtl.mm:
(rx::ProgramMtl::ProgramMtl):
(rx::ProgramMtl::linkImplSpirv):
(rx::ProgramMtl::linkImplDirect):
(rx::ProgramMtl::linkTranslatedShaders):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (274989 => 274990)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-03-25 00:46:39 UTC (rev 274989)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-03-25 01:06:18 UTC (rev 274990)
@@ -1,3 +1,19 @@
+2021-03-24  Kyle Piddington  <[email protected]>
+
+        Metal ANGLE crashes LayoutTests/inspector/canvas/updateShader-webgl.html
+	Rather than rely on an instance variable in a C++ class, just query the dictionary constant when needed.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=223695
+
+        Reviewed by Dean Jackson.
+
+        * src/libANGLE/renderer/metal/ProgramMtl.h:
+        * src/libANGLE/renderer/metal/ProgramMtl.mm:
+        (rx::ProgramMtl::ProgramMtl):
+        (rx::ProgramMtl::linkImplSpirv):
+        (rx::ProgramMtl::linkImplDirect):
+        (rx::ProgramMtl::linkTranslatedShaders):
+
 2021-03-23  Kyle Piddington  <[email protected]>
 
         ANGLE Metal fixes for program generation bugs

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.h (274989 => 274990)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.h	2021-03-25 00:46:39 UTC (rev 274989)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.h	2021-03-25 01:06:18 UTC (rev 274990)
@@ -275,7 +275,6 @@
 
     mtl::RenderPipelineCache mMetalRenderPipelineCache;
     std::array<uint32_t, mtl::kMaxShaderXFBs> mXfbBindings;
-    NSDictionary<NSString *, NSObject *> * mDefaultSubstitutionDictionary;
     mtl::BufferPool * mAuxBufferPool;
 };
 

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm (274989 => 274990)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm	2021-03-25 00:46:39 UTC (rev 274989)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm	2021-03-25 01:06:18 UTC (rev 274990)
@@ -96,6 +96,19 @@
     return;
 }
 
+inline NSDictionary<NSString *, NSObject *> * getDefaultSubstitutionDictionary() {
+#if ANGLE_ENABLE_METAL_SPIRV
+    if (sh::readBoolEnvVar("ANGLE_GEN_MTL_WITH_SPIRV"))
+    {
+        return @{};
+    }
+    else
+#endif
+    {
+        return @{@"TRANSFORM_FEEDBACK_ENABLED": @"0"};
+    }
+}
+
 template <typename T>
 void UpdateDefaultUniformBlock(GLsizei count,
                                uint32_t arrayIndex,
@@ -240,16 +253,6 @@
     mAuxBufferPool(nullptr)
 {
     mMetalXfbRenderPipelineCache = new mtl::RenderPipelineCache(this);
-#if ANGLE_ENABLE_METAL_SPIRV
-    if (sh::readBoolEnvVar("ANGLE_GEN_MTL_WITH_SPIRV"))
-    {
-        mDefaultSubstitutionDictionary = @{};
-    }
-    else
-#endif
-    {
-        mDefaultSubstitutionDictionary = @{@"TRANSFORM_FEEDBACK_ENABLED": @"0"};
-    }
 }
 
 ProgramMtl::~ProgramMtl()
@@ -415,7 +418,7 @@
     {
         // Create actual Metal shader library
         ANGLE_TRY(createMslShaderLib(contextMtl, shaderType, infoLog,
-                                     &mMslShaderTranslateInfo[shaderType], mDefaultSubstitutionDictionary));
+                                     &mMslShaderTranslateInfo[shaderType], getDefaultSubstitutionDictionary()));
     }
 
     return angle::Result::Continue;
@@ -445,7 +448,7 @@
     {
         // Create actual Metal shader
         ANGLE_TRY(
-                  createMslShaderLib(contextMtl, shaderType, infoLog, &mMslShaderTranslateInfo[shaderType], mDefaultSubstitutionDictionary));
+                  createMslShaderLib(contextMtl, shaderType, infoLog, &mMslShaderTranslateInfo[shaderType], getDefaultSubstitutionDictionary()));
     }
     // Save this, could be reset on shader destruction. These values will eventually be written out and restored in
     // saveTranslatedShaders/loadTranslatedShaders
@@ -484,9 +487,9 @@
     ANGLE_TRY(loadDefaultUniformBlocksInfo(glContext, stream));
 
     ANGLE_TRY(createMslShaderLib(contextMtl, gl::ShaderType::Vertex, infoLog,
-                              &mMslShaderTranslateInfo[gl::ShaderType::Vertex], mDefaultSubstitutionDictionary));
+                              &mMslShaderTranslateInfo[gl::ShaderType::Vertex], getDefaultSubstitutionDictionary()));
     ANGLE_TRY(createMslShaderLib(contextMtl, gl::ShaderType::Fragment, infoLog,
-                              &mMslShaderTranslateInfo[gl::ShaderType::Fragment], mDefaultSubstitutionDictionary));
+                              &mMslShaderTranslateInfo[gl::ShaderType::Fragment], getDefaultSubstitutionDictionary()));
 
     return angle::Result::Continue;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to