RESOLVED FIXED 226423
[WebXR] Provide a way to bind and unbind IOSurfaces to ANGLE Pbuffers
https://bugs.webkit.org/show_bug.cgi?id=226423
Summary [WebXR] Provide a way to bind and unbind IOSurfaces to ANGLE Pbuffers
Dean Jackson
Reported 2021-05-29 13:34:34 PDT
WebXR on Cocoa platforms gets framebuffer texture targets via IOSurfaces. Those must be attached to ANGLE Pbuffers, which are then bound to GL textures. There is already some code in GraphicsContextGL (and in the CoreVideo classes) to do this, but this is an attempt to make a generic function that will handle all use cases.
Attachments
Patch (5.56 KB, patch)
2021-05-29 13:39 PDT, Dean Jackson
no flags
Patch (5.89 KB, patch)
2021-05-30 12:58 PDT, Dean Jackson
sam: review+
ews-feeder: commit-queue-
Radar WebKit Bug Importer
Comment 1 2021-05-29 13:34:46 PDT
Dean Jackson
Comment 2 2021-05-29 13:39:14 PDT
Sam Weinig
Comment 3 2021-05-29 13:44:35 PDT
Comment on attachment 430106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430106&action=review > Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:651 > + auto usageHintAngle = [&] () -> EGLint { > + if (usage == PbufferAttachmentUsage::Read) > + return EGL_IOSURFACE_READ_HINT_ANGLE; > + return EGL_IOSURFACE_WRITE_HINT_ANGLE; > + }(); Never both? > Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:574 > + friend class WebXROpaqueFramebuffer; This is a layering violation. Platform level concepts should not be aware of things like WebXR. Why is this needed? Why not just make this public? > Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:578 > + enum class PbufferAttachmentUsage { > + Read, > + Write > + }; I would put this all on one line.
Dean Jackson
Comment 4 2021-05-30 12:47:36 PDT
Comment on attachment 430106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430106&action=review >> Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:651 >> + }(); > > Never both? Good point. I'll check if ANGLE handles that and add it if so. >> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:574 >> + friend class WebXROpaqueFramebuffer; > > This is a layering violation. Platform level concepts should not be aware of things like WebXR. Why is this needed? Why not just make this public? Duh, of course. Yeah, I'll make them public. >> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:578 >> + }; > > I would put this all on one line. ok!
Dean Jackson
Comment 5 2021-05-30 12:58:31 PDT
Dean Jackson
Comment 6 2021-05-30 15:47:13 PDT
Note You need to log in before you can comment on or make changes to this bug.