mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/WebGL: Use eglWaitUntilWorkScheduledANGLE instead of glFlush
With the Metal backend, glFlush flushes the command buffer, but doesn't wait for the commands to be scheduled on the GPU. eglWaitUntilWorkScheduledANGLE does wait, hence the name. This fixes flickering on Rive animations rendered with WebGL.
This commit is contained in:
committed by
Andrew Kaster
parent
426cd455bc
commit
3139f6a25a
Notes:
github-actions[bot]
2025-06-09 21:41:43 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/3139f6a25a8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4056 Reviewed-by: https://github.com/ADKaster
@@ -106,16 +106,7 @@ void WebGLRenderingContext::present()
|
||||
return;
|
||||
|
||||
m_should_present = false;
|
||||
|
||||
// "Before the drawing buffer is presented for compositing the implementation shall ensure that all rendering operations have been flushed to the drawing buffer."
|
||||
glFlush();
|
||||
|
||||
// "By default, after compositing the contents of the drawing buffer shall be cleared to their default values, as shown in the table above.
|
||||
// This default behavior can be changed by setting the preserveDrawingBuffer attribute of the WebGLContextAttributes object.
|
||||
// If this flag is true, the contents of the drawing buffer shall be preserved until the author either clears or overwrites them."
|
||||
if (!m_context_creation_parameters.preserve_drawing_buffer) {
|
||||
context().clear_buffer_to_default_values();
|
||||
}
|
||||
context().present(m_context_creation_parameters.preserve_drawing_buffer);
|
||||
}
|
||||
|
||||
GC::Ref<HTML::HTMLCanvasElement> WebGLRenderingContext::canvas_for_binding() const
|
||||
|
||||
Reference in New Issue
Block a user