LibWeb: Small WebGL spec fix for vertexAttribPointer

This commit is contained in:
Undefine 2025-11-05 22:34:17 +01:00 committed by Andreas Kling
parent 5caead88fc
commit 2a73f779c3
Notes: github-actions[bot] 2025-11-06 18:04:08 +00:00

View file

@ -2206,6 +2206,12 @@ void WebGLRenderingContextImpl::vertex_attrib_pointer(WebIDL::UnsignedLong index
{
m_context->make_current();
// If no WebGLBuffer is bound to the ARRAY_BUFFER target and offset is non-zero, an INVALID_OPERATION error will be generated.
if (!m_array_buffer_binding && offset != 0) {
set_error(GL_INVALID_OPERATION);
return;
}
glVertexAttribPointer(index, size, type, normalized, stride, reinterpret_cast<void*>(offset));
}