mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb/WebGL2: Implement waitSync
This commit is contained in:
committed by
Jelle Raaijmakers
parent
3005cc30b4
commit
39d42b7b73
Notes:
github-actions[bot]
2025-10-21 21:33:53 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/39d42b7b73c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6538 Reviewed-by: https://github.com/gmta ✅
@@ -787,6 +787,23 @@ WebIDL::UnsignedLong WebGL2RenderingContextImpl::client_wait_sync(GC::Root<WebGL
|
||||
return glClientWaitSync(sync_handle, flags, timeout);
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::wait_sync(GC::Root<WebGLSync> sync, WebIDL::UnsignedLong flags, WebIDL::UnsignedLongLong timeout)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
GLsync sync_handle = nullptr;
|
||||
if (sync) {
|
||||
auto handle_or_error = sync->sync_handle(this);
|
||||
if (handle_or_error.is_error()) {
|
||||
set_error(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
sync_handle = static_cast<GLsync>(handle_or_error.release_value());
|
||||
}
|
||||
|
||||
glWaitSync(sync_handle, flags, timeout);
|
||||
}
|
||||
|
||||
JS::Value WebGL2RenderingContextImpl::get_sync_parameter(GC::Root<WebGLSync> sync, WebIDL::UnsignedLong pname)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
Reference in New Issue
Block a user