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] Refactor WebXROpaqueFramebuffer::setupFramebuffer #14172

Merged

Conversation

djg
Copy link
Contributor

@djg djg commented May 22, 2023

12c38ed

[WebXR] Refactor WebXROpaqueFramebuffer::setupFramebuffer
https://bugs.webkit.org/show_bug.cgi?id=257117
rdar://problem/109647523

Reviewed by Dean Jackson.

Reduce the complicated nesting of if/else statement by extracting common parts
into helper functions.

No features changed.

* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt:
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
(WebCore::WebXROpaqueFramebuffer::allocateRenderbufferStorage):
(WebCore::WebXROpaqueFramebuffer::allocateColorStorage):
(WebCore::WebXROpaqueFramebuffer::allocateDepthStencilStorage):
(WebCore::WebXROpaqueFramebuffer::bindColor):
(WebCore::WebXROpaqueFramebuffer::bindDepthStencil):
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:

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

3d87b20

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   πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
  πŸ›  watch-sim

@djg djg self-assigned this May 22, 2023
@djg djg added the WebXR For bugs in WebXR label May 22, 2023
@djg djg requested a review from grorg May 22, 2023 09:10
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 22, 2023
// Cap the maximum multisample count at 4. Any more than this is likely overkill and will impact performance.
return std::min(4, maxSampleCount);
};
int sampleCount = (isAntialias) ? maxSamples(gl) : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably assign sampleCount to directly calling the lambda immediately. We only use sampleCount if we're antialiased.

}
return gl.checkFramebufferStatus(GL::FRAMEBUFFER) == GL::FRAMEBUFFER_COMPLETE;
auto colorBuffer = allocateColorStorage(gl, sampleCount, m_width, m_height);
bindColor(gl, colorBuffer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be bindColorBuffer

PlatformGLObject depthBuffer = 0;
PlatformGLObject stencilBuffer = 0;

// FIXME: Does this need to be optional?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some non-Apple implementations that don't support the packed format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was moved and pre-existed. I've added a // FIXME: that we should do something depending upon context or remove the code.

@djg djg removed the merging-blocked Applied to prevent a change from being merged label May 23, 2023
@djg djg changed the title [WebXR] Refactor WebXROpaqueFramebuffer::setupFramebuffer Debug Logging May 23, 2023
@djg djg force-pushed the webxr/refactor-setup-framebuffer branch from f12f4ac to ff55789 Compare May 23, 2023 00:45
@djg djg added the skip-ews Applied to prevent a change from being run on EWS label May 23, 2023
@djg djg removed the skip-ews Applied to prevent a change from being run on EWS label May 23, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 23, 2023
@djg djg removed the merging-blocked Applied to prevent a change from being merged label May 24, 2023
@djg djg changed the title Debug Logging [WebXR] Refactor WebXROpaqueFramebuffer::setupFramebuffer May 24, 2023
@djg djg force-pushed the webxr/refactor-setup-framebuffer branch from ff55789 to 3d87b20 Compare May 24, 2023 04:03
@djg djg added the skip-ews Applied to prevent a change from being run on EWS label May 24, 2023
@djg djg added merge-queue Applied to send a pull request to merge-queue and removed skip-ews Applied to prevent a change from being run on EWS labels May 24, 2023
https://bugs.webkit.org/show_bug.cgi?id=257117
rdar://problem/109647523

Reviewed by Dean Jackson.

Reduce the complicated nesting of if/else statement by extracting common parts
into helper functions.

No features changed.

* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt:
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
(WebCore::WebXROpaqueFramebuffer::allocateRenderbufferStorage):
(WebCore::WebXROpaqueFramebuffer::allocateColorStorage):
(WebCore::WebXROpaqueFramebuffer::allocateDepthStencilStorage):
(WebCore::WebXROpaqueFramebuffer::bindColor):
(WebCore::WebXROpaqueFramebuffer::bindDepthStencil):
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:

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

Committed 264466@main (12c38ed): https://commits.webkit.org/264466@main

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

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 24, 2023
@webkit-commit-queue webkit-commit-queue merged commit 12c38ed into WebKit:main May 24, 2023
@djg djg deleted the webxr/refactor-setup-framebuffer branch May 24, 2023 23:18
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