-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Enable implicit clear for WebXROpaqueFramebuffer #23209
Conversation
EWS run on previous version of this PR (hash 6e0f313) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct.
WebXR framebuffer must be cleared before session rAF, regardless of whether the client draws anything or not.
I think your initial problem to solve is "WebXR does not clear the session framebuffer before rAF".
The solution should be "clear the session framebuffer before rAF".
I think we could focus on optimizing clears if they are problems.
The WebGL clear optimizaiton was a more pressing matter when the preserveDrawingBuffer was default and/or supported. WebXR doesn't have these issues.
class WebGLRenderingContextBase; | ||
|
||
// Interface to state related to a set of framebuffer attachments. | ||
class WebGLFramebufferBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only correctly maintained for WebGLDefaultFramebuffer, WebXROpaqueFramebuffer.
These are not correctly maintained for WebGLFramebuffer.
The correct, minimal interface would be:
class WebGLFramebufferBase {
public:
void clearIfNeeded(...) { }
};
However, I don't think this is needed for WebXR.
6e0f313
to
c7cdf38
Compare
EWS run on previous version of this PR (hash c7cdf38) |
} | ||
|
||
private: | ||
WebGLRenderingContextBase& m_context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could store the m_context as ptr instead of having m_enabled
} | ||
|
||
private: | ||
WebGLRenderingContextBase& m_context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could store the context as ptr instead of having m_enabled
c7cdf38
to
e8de6d2
Compare
EWS run on current version of this PR (hash e8de6d2) |
https://bugs.webkit.org/show_bug.cgi?id=268042 rdar://117090654 Reviewed by Kimmo Kinnunen. WebGL's default framebuffer has an implicit clear behavior. The WebXR specification requires the same behavior for its WebXROpaqueFramebuffer, therefore WebXR must ensure that it's buffers are always cleared for each rAF of the session. Currently we assume content does not do redundant initial clear, as the spec says the buffer always starts cleared. * Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp: (WebCore::WebXROpaqueFramebuffer::startFrame): (WebCore::WebXROpaqueFramebuffer::setupFramebuffer): * Source/WebCore/html/canvas/WebGLRenderingContextBase.h: * Source/WebCore/html/canvas/WebGLUtilities.h: (WebCore::ScopedClearColorAndMask::ScopedClearColorAndMask): (WebCore::ScopedClearColorAndMask::~ScopedClearColorAndMask): (WebCore::ScopedClearDepthAndMask::ScopedClearDepthAndMask): (WebCore::ScopedClearDepthAndMask::~ScopedClearDepthAndMask): (WebCore::ScopedClearStencilAndMask::ScopedClearStencilAndMask): (WebCore::ScopedClearStencilAndMask::~ScopedClearStencilAndMask): Canonical link: https://commits.webkit.org/274121@main
e8de6d2
to
153d8bb
Compare
Committed 274121@main (153d8bb): https://commits.webkit.org/274121@main Reviewed commits have been landed. Closing PR #23209 and removing active labels. |
153d8bb
e8de6d2
π macπ wincairoπ§ͺ bindingsπ mac-AS-debugπ§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-macπ§ͺ api-wpeπ§ͺ ios-wk2-wptπ§ͺ mac-wk1π§ͺ api-iosπ§ͺ mac-wk2π§ͺ gtk-wk2π tvπ§ͺ mac-AS-debug-wk2π§ͺ api-gtkπ tv-simπ§ͺ mac-wk2-stressπ watchπ watch-sim