Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebXR] Pass depth texture in frame data #15396

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

djg
Copy link
Contributor

@djg djg commented Jun 29, 2023

9e2a90f

[WebXR] Pass depth texture in frame data
https://bugs.webkit.org/show_bug.cgi?id=258661
rdar://111501806

Reviewed by Dean Jackson.

Render to compositor provided depth-stencil buffers.

* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::createAndBindCompositorTexture):
(WebCore::createAndBindCompositorBuffer):
(WebCore::makeEGLImageSource):
(WebCore::WebXROpaqueFramebuffer::create):
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::endFrame):
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
(WebCore::WebXROpaqueFramebuffer::allocateColorStorage):
(WebCore::WebXROpaqueFramebuffer::allocateDepthStencilStorage):
(WebCore::WebXROpaqueFramebuffer::bindDepthStencilBuffer):
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::createAndBindEGLImage):
* Source/WebCore/platform/xr/PlatformXR.h:
(PlatformXR::Device::FrameData::LayerData::encode const):
(PlatformXR::Device::FrameData::LayerData::decode):

Canonical link: https://commits.webkit.org/266053@main

bfb68e6

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@djg djg self-assigned this Jun 29, 2023
@djg djg added the WebXR For bugs in WebXR label Jun 29, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 29, 2023
@grorg
Copy link
Contributor

grorg commented Jun 30, 2023

Can't land at the moment though.

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x24d2382cc __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x24d31019c pthread_kill + 268
2   libsystem_c.dylib             	       0x24d1a5c18 abort + 180
3   libsystem_c.dylib             	       0x24d1a4f34 __assert_rtn + 284
4   Metal                         	       0x1bb776ca4 MTLReportFailure.cold.1 + 48
5   Metal                         	       0x1bb74d5c8 MTLReportFailure + 464
6   Metal                         	       0x1bb742c98 _MTLMessageContextEnd + 860
7   Metal                         	       0x1bb6d2024 -[MTLTextureDescriptorInternal validateWithDevice:] + 2280
8   AGXMetalG14G                  	       0x1a632d558 -[AGXTexture initWithSharedTextureHandle:device:desc:compressionMode:] + 64
9   WebCore                       	       0x10ebf4000 decltype(auto) std::__1::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch[abi:v160002]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_0, WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_1>>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>&&>(std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_0, WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_1>>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>&&) + 120
10  WebCore                       	       0x10ebf1d9c WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>) + 148
11  WebCore                       	       0x10fa43780 WebCore::WebXROpaqueFramebuffer::startFrame(PlatformXR::Device::FrameData::LayerData const&) + 1000

@djg djg removed the merging-blocked Applied to prevent a change from being merged label Jul 11, 2023
@djg djg force-pushed the webxr/compositor-depth-texture branch from 2433c35 to 4d9c2cb Compare July 11, 2023 06:54
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jul 11, 2023
@djg djg removed the merging-blocked Applied to prevent a change from being merged label Jul 12, 2023
@djg djg force-pushed the webxr/compositor-depth-texture branch from 4d9c2cb to bfb68e6 Compare July 12, 2023 05:29
@djg
Copy link
Contributor Author

djg commented Jul 14, 2023

Can't land at the moment though.

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x24d2382cc __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x24d31019c pthread_kill + 268
2   libsystem_c.dylib             	       0x24d1a5c18 abort + 180
3   libsystem_c.dylib             	       0x24d1a4f34 __assert_rtn + 284
4   Metal                         	       0x1bb776ca4 MTLReportFailure.cold.1 + 48
5   Metal                         	       0x1bb74d5c8 MTLReportFailure + 464
6   Metal                         	       0x1bb742c98 _MTLMessageContextEnd + 860
7   Metal                         	       0x1bb6d2024 -[MTLTextureDescriptorInternal validateWithDevice:] + 2280
8   AGXMetalG14G                  	       0x1a632d558 -[AGXTexture initWithSharedTextureHandle:device:desc:compressionMode:] + 64
9   WebCore                       	       0x10ebf4000 decltype(auto) std::__1::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch[abi:v160002]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_0, WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_1>>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>&&>(std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_0, WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>)::$_1>>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>&&) + 120
10  WebCore                       	       0x10ebf1d9c WebCore::GraphicsContextGLCocoa::createAndBindEGLImage(unsigned int, std::__1::variant<WebCore::GraphicsContextGL::EGLImageSourceIOSurfaceHandle, WebCore::GraphicsContextGL::EGLImageSourceMTLSharedTextureHandle>) + 148
11  WebCore                       	       0x10fa43780 WebCore::WebXROpaqueFramebuffer::startFrame(PlatformXR::Device::FrameData::LayerData const&) + 1000

@mwyrzykowski tested locally and reported this is no longer an issue.

@djg djg added the merge-queue Applied to send a pull request to merge-queue label Jul 14, 2023
https://bugs.webkit.org/show_bug.cgi?id=258661
rdar://111501806

Reviewed by Dean Jackson.

Render to compositor provided depth-stencil buffers.

* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::createAndBindCompositorTexture):
(WebCore::createAndBindCompositorBuffer):
(WebCore::makeEGLImageSource):
(WebCore::WebXROpaqueFramebuffer::create):
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::endFrame):
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
(WebCore::WebXROpaqueFramebuffer::allocateColorStorage):
(WebCore::WebXROpaqueFramebuffer::allocateDepthStencilStorage):
(WebCore::WebXROpaqueFramebuffer::bindDepthStencilBuffer):
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::createAndBindEGLImage):
* Source/WebCore/platform/xr/PlatformXR.h:
(PlatformXR::Device::FrameData::LayerData::encode const):
(PlatformXR::Device::FrameData::LayerData::decode):

Canonical link: https://commits.webkit.org/266053@main
@webkit-commit-queue
Copy link
Collaborator

Committed 266053@main (9e2a90f): https://commits.webkit.org/266053@main

Reviewed commits have been landed. Closing PR #15396 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 14, 2023
@webkit-commit-queue webkit-commit-queue merged commit 9e2a90f into WebKit:main Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebXR For bugs in WebXR
Projects
None yet
5 participants