mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Ensure WebGL buffers don't mix between index and other data
The spec mandates that a buffer during its lifetime can only get bound to either an index buffer or any other type.
This commit is contained in:
parent
85478c9215
commit
7d6212ae71
Notes:
github-actions[bot]
2025-11-27 18:21:19 +00:00
Author: https://github.com/cqundefine
Commit: 7d6212ae71
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6744
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/konradekk
4 changed files with 38 additions and 0 deletions
|
|
@ -134,6 +134,11 @@ void WebGLRenderingContextImpl::bind_buffer(WebIDL::UnsignedLong target, GC::Roo
|
|||
return;
|
||||
}
|
||||
buffer_handle = handle_or_error.release_value();
|
||||
|
||||
if (!buffer->is_compatible_with(target)) {
|
||||
set_error(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_context->webgl_version() == OpenGLContext::WebGLVersion::WebGL2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue