Bug 227586 - ANGLE Metal Buffers created out of IOSurfaces should take the EGL_IOSURFACE_USAGE_HINT_ANGLE into account
Summary: ANGLE Metal Buffers created out of IOSurfaces should take the EGL_IOSURFACE_U...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 231031
  Show dependency treegraph
 
Reported: 2021-07-01 08:22 PDT by Kimmo Kinnunen
Modified: 2021-10-23 05:33 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2021-07-01 08:22:59 PDT
ANGLE Metal Buffers created out of IOSurfaces should take the EGL_IOSURFACE_USAGE_HINT_ANGLE into account

The attribute EGL_IOSURFACE_USAGE_HINT_ANGLE may optionally be specified as
    a combination of the bits EGL_IOSURFACE_READ_HINT_ANGLE and
    EGL_IOSURFACE_WRITE_HINT_ANGLE. On the iOS Simulator platform, where
    IOSurface support is incomplete, these hints indicate whether the intent is
    to read from the IOSurface, write to it, or both. Explicitly passing 0 for
    this attribute is equivalent to setting both the read and write usage
    bits. This attribute is ignored on other platforms."

angle::Result IOSurfaceSurfaceMtl::ensureColorTextureCreated(const gl::Context *context)
{
    if (mColorTexture)
    {
        return angle::Result::Continue;
    }
    ContextMtl *contextMtl = mtl::GetImpl(context);
    ANGLE_MTL_OBJC_SCOPE
    {
        auto texDesc =
            [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:mColorFormat.metalFormat
                                                               width:mSize.width
                                                              height:mSize.height
                                                           mipmapped:NO];

        texDesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget;
Comment 1 Radar WebKit Bug Importer 2021-07-08 08:23:17 PDT
<rdar://problem/80324846>