Changeset 284927 in webkit


Ignore:
Timestamp:
Oct 27, 2021, 10:43:38 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION (Safari 15): Poor WebGL performance on https://downloads.scirra.com/labs/particles
https://bugs.webkit.org/show_bug.cgi?id=230749
<rdar://problem/83576271>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-10-27
Reviewed by Kenneth Russell.

The site would draw indexed per frame with each frame increasing the size of the draw.
This would cause index buffer range cache update for each draw.
Range computation needs to look inside the index buffer.
Mapping the index buffer for read would cause command buffer flush for each computation,
since previous frame would have used the index buffer for reading. This would cause
performance degradation for the duration where the range cache would need update.

Since the buffer is read by the draw but not written, the map should be a no-op.
Consult the "CPU memory needs synchronizing" flag of the mtl::Resource when
mapping. Only synchronize with GPU if the memory needs synchronizing.

  • src/libANGLE/renderer/metal/mtl_resources.mm:

(rx::mtl::Buffer::mapWithOpt):

Location:
trunk/Source/ThirdParty/ANGLE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r284849 r284927  
     12021-10-27  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        REGRESSION (Safari 15): Poor WebGL performance on https://downloads.scirra.com/labs/particles
     4        https://bugs.webkit.org/show_bug.cgi?id=230749
     5        <rdar://problem/83576271>
     6
     7        Reviewed by Kenneth Russell.
     8
     9        The site would draw indexed per frame with each frame increasing the size of the draw.
     10        This would cause index buffer range cache update for each draw.
     11        Range computation needs to look inside the index buffer.
     12        Mapping the index buffer for read would cause command buffer flush for each computation,
     13        since previous frame would have used the index buffer for reading. This would cause
     14        performance degradation for the duration where the range cache would need update.
     15
     16        Since the buffer is read by the draw but not written, the map should be a no-op.
     17        Consult the "CPU memory needs synchronizing" flag of the mtl::Resource when
     18        mapping. Only synchronize with GPU if the memory needs synchronizing.
     19
     20        * src/libANGLE/renderer/metal/mtl_resources.mm:
     21        (rx::mtl::Buffer::mapWithOpt):
     22
    1232021-10-25  Kyle Piddington  <kpiddington@apple.com>
    224
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_resources.mm

    r277824 r284927  
    10011001    mMapReadOnly = readonly;
    10021002
    1003     if (!noSync)
     1003    if (!noSync && (isCPUReadMemNeedSync() || !readonly))
    10041004    {
    10051005        CommandQueue &cmdQueue = context->cmdQueue();
Note: See TracChangeset for help on using the changeset viewer.