mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Fix WebGL getError
getError was just calling out to glGetError and never checking our error value that we were maintaining ourselves.
This commit is contained in:
Notes:
github-actions[bot]
2025-11-06 18:04:36 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/044ac2dd28f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6711 Reviewed-by: https://github.com/awesomekling
@@ -195,8 +195,23 @@ Optional<WebGLRenderingContextBase::ConvertedTexture> WebGLRenderingContextBase:
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: The glGetError spec allows for queueing errors which is something we should probably do, for now
|
||||
// this just keeps track of one error which is also fine by the spec
|
||||
GLenum WebGLRenderingContextBase::get_error_value()
|
||||
{
|
||||
if (m_error == GL_NO_ERROR)
|
||||
return glGetError();
|
||||
|
||||
auto error = m_error;
|
||||
m_error = GL_NO_ERROR;
|
||||
return error;
|
||||
}
|
||||
|
||||
void WebGLRenderingContextBase::set_error(GLenum error)
|
||||
{
|
||||
if (m_error != GL_NO_ERROR)
|
||||
return;
|
||||
|
||||
auto context_error = glGetError();
|
||||
if (context_error != GL_NO_ERROR)
|
||||
m_error = context_error;
|
||||
|
||||
Reference in New Issue
Block a user