Title: [284835] branches/safari-612-branch/Source/ThirdParty/ANGLE
Revision
284835
Author
[email protected]
Date
2021-10-25 14:51:13 -0700 (Mon, 25 Oct 2021)

Log Message

Cherry-pick r284125. rdar://problem/84630015

    Upstream ANGLE: PrimitiveRestart tests fail due to incorrect draw commands
    https://bugs.webkit.org/show_bug.cgi?id=231626
    <rdar:/problem/84167241>

    Primitive restart draw commands were being encoded
    incorrectly. Single element ranges were being disregarded,
    and a maximum draw size was not being enforced when the
    index buffer was aliased / reused.

    Cherry-pick from upstream anglebug.com/6535

    Reviewed by Kenneth Russell.

    * src/libANGLE/renderer/metal/VertexArrayMtl.mm:
    (rx::VertexArrayMtl::getDrawIndices):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612-branch/Source/ThirdParty/ANGLE/ChangeLog (284834 => 284835)


--- branches/safari-612-branch/Source/ThirdParty/ANGLE/ChangeLog	2021-10-25 21:51:10 UTC (rev 284834)
+++ branches/safari-612-branch/Source/ThirdParty/ANGLE/ChangeLog	2021-10-25 21:51:13 UTC (rev 284835)
@@ -1,5 +1,46 @@
 2021-10-25  Null  <[email protected]>
 
+        Cherry-pick r284125. rdar://problem/84630015
+
+    Upstream ANGLE: PrimitiveRestart tests fail due to incorrect draw commands
+    https://bugs.webkit.org/show_bug.cgi?id=231626
+    <rdar:/problem/84167241>
+    
+    Primitive restart draw commands were being encoded
+    incorrectly. Single element ranges were being disregarded,
+    and a maximum draw size was not being enforced when the
+    index buffer was aliased / reused.
+    
+    Cherry-pick from upstream anglebug.com/6535
+    
+    Reviewed by Kenneth Russell.
+    
+    * src/libANGLE/renderer/metal/VertexArrayMtl.mm:
+    (rx::VertexArrayMtl::getDrawIndices):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-13  Kyle Piddington  <[email protected]>
+
+            Upstream ANGLE: PrimitiveRestart tests fail due to incorrect draw commands
+            https://bugs.webkit.org/show_bug.cgi?id=231626
+            <rdar:/problem/84167241>
+
+            Primitive restart draw commands were being encoded
+            incorrectly. Single element ranges were being disregarded,
+            and a maximum draw size was not being enforced when the
+            index buffer was aliased / reused.
+
+            Cherry-pick from upstream anglebug.com/6535
+
+            Reviewed by Kenneth Russell.
+
+            * src/libANGLE/renderer/metal/VertexArrayMtl.mm:
+            (rx::VertexArrayMtl::getDrawIndices):
+
+2021-10-25  Null  <[email protected]>
+
         Cherry-pick r282627. rdar://problem/84630078
 
     webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal

Modified: branches/safari-612-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm (284834 => 284835)


--- branches/safari-612-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm	2021-10-25 21:51:10 UTC (rev 284834)
+++ branches/safari-612-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm	2021-10-25 21:51:13 UTC (rev 284835)
@@ -787,10 +787,14 @@
     {
         if (range.restartBegin > currentIndexOffset)
         {
-            int64_t nIndicesInSlice = ((int64_t)range.restartBegin - currentIndexOffset) - ((int64_t) range.restartBegin - currentIndexOffset) % nIndicesPerPrimitive;
+            int64_t nIndicesInSlice = MIN(((int64_t)range.restartBegin - currentIndexOffset) -
+                                          ((int64_t)range.restartBegin - currentIndexOffset) % nIndicesPerPrimitive,
+                                      indicesLeft);
             size_t restartSize = (range.restartEnd - range.restartBegin) + 1;
-            if (nIndicesInSlice > nIndicesPerPrimitive)
+            if (nIndicesInSlice >= nIndicesPerPrimitive)
+            {
                 drawCommands.push_back({(uint32_t) nIndicesInSlice, currentIndexOffset * indexTypeBytes});
+            }
             // Account for dropped indices due to incomplete primitives.
             size_t indicesUsed = ( (range.restartBegin + restartSize) - currentIndexOffset);
             if (indicesLeft <= indicesUsed)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to