⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276567 in webkit


Ignore:
Timestamp:
Apr 25, 2021, 12:06:07 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[Metal ANGLE] Select proper IOSurface backing format for WebGL environment
https://bugs.webkit.org/show_bug.cgi?id=224948
<rdar://76284889>

Depending on the architecture, WebCore expects different
IOSurface texture targets for the main buffer. When running catalyst on
Arm64 devices, Metal-ANGLE needs to select the TEXTURE_2D texture target for our
IOSurface/Pbuffer bind point, rather than TEXTURE_RECTANGLE.

Reviewed by Dean Jackson.

Patch by Kyle Piddington <Kyle Piddington> on 2021-04-25

  • src/libANGLE/renderer/metal/DisplayMtl.h:
  • src/libANGLE/renderer/metal/DisplayMtl.mm:

(rx::needsEAGLOnMac):
(rx::DisplayMtl::EGLDrawingBufferTextureTarget):
(rx::DisplayMtl::generateConfigs):

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

Legend:

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

    r276507 r276567  
     12021-04-25  Kyle Piddington  <kpiddington@apple.com>
     2
     3        [Metal ANGLE] Select proper IOSurface backing format for WebGL environment
     4        https://bugs.webkit.org/show_bug.cgi?id=224948
     5        <rdar://76284889>
     6
     7        Depending on the architecture, WebCore expects different
     8        IOSurface texture targets for the main buffer. When running catalyst on
     9        Arm64 devices, Metal-ANGLE needs to select the TEXTURE_2D texture target for our
     10        IOSurface/Pbuffer bind point, rather than TEXTURE_RECTANGLE.
     11
     12        Reviewed by Dean Jackson.
     13
     14        * src/libANGLE/renderer/metal/DisplayMtl.h:
     15        * src/libANGLE/renderer/metal/DisplayMtl.mm:
     16        (rx::needsEAGLOnMac):
     17        (rx::DisplayMtl::EGLDrawingBufferTextureTarget):
     18        (rx::DisplayMtl::generateConfigs):
     19
    1202021-04-23  Truitt Savell  <tsavell@apple.com>
    221
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.h

    r275685 r276567  
    166166    void initializeFeatures();
    167167    void initializeLimitations();
     168    EGLenum EGLDrawingBufferTextureTarget();
    168169    id<MTLDevice> getMetalDeviceMatchingAttribute(const egl::AttributeMap &attribs);
    169170    angle::Result initializeShaderLibrary();
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm

    r275841 r276567  
    438438void DisplayMtl::populateFeatureList(angle::FeatureList *features) {}
    439439
     440#if TARGET_OS_MACCATALYST
     441static bool needsEAGLOnMac()
     442{
     443#if defined(__arm64__) || defined(__aarch64__)
     444    return true;
     445#else
     446    return false;
     447#endif
     448}
     449#endif
     450
     451EGLenum DisplayMtl::EGLDrawingBufferTextureTarget()
     452{
     453#if TARGET_OS_MACCATALYST
     454    if (needsEAGLOnMac())
     455        return EGL_TEXTURE_2D;
     456    return EGL_TEXTURE_RECTANGLE_ANGLE;
     457#elif TARGET_OS_OSX
     458    return EGL_TEXTURE_RECTANGLE_ANGLE;
     459#else
     460    return EGL_TEXTURE_2D;
     461#endif
     462}
    440463egl::ConfigSet DisplayMtl::generateConfigs()
    441464{
     
    461484
    462485    // Pbuffer
    463 #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
    464     config.bindToTextureTarget = EGL_TEXTURE_RECTANGLE_ANGLE;
    465 #else
    466     config.bindToTextureTarget = EGL_TEXTURE_2D;
    467 #endif
     486    config.bindToTextureTarget = EGLDrawingBufferTextureTarget();
    468487    config.maxPBufferWidth  = 4096;
    469488    config.maxPBufferHeight = 4096;
Note: See TracChangeset for help on using the changeset viewer.