mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL2: Implement waitSync
This commit is contained in:
parent
3005cc30b4
commit
39d42b7b73
Notes:
github-actions[bot]
2025-10-21 21:33:53 +00:00
Author: https://github.com/Lubrsi
Commit: 39d42b7b73
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6538
Reviewed-by: https://github.com/gmta ✅
3 changed files with 19 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue