From 2a73f779c39e7e4c8ef0bbbc3bbc2c1f9cc9182a Mon Sep 17 00:00:00 2001 From: Undefine Date: Wed, 5 Nov 2025 22:34:17 +0100 Subject: [PATCH] LibWeb: Small WebGL spec fix for vertexAttribPointer --- Libraries/LibWeb/WebGL/WebGLRenderingContextImpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibWeb/WebGL/WebGLRenderingContextImpl.cpp b/Libraries/LibWeb/WebGL/WebGLRenderingContextImpl.cpp index 9734ebced9f..13dc9a0de44 100644 --- a/Libraries/LibWeb/WebGL/WebGLRenderingContextImpl.cpp +++ b/Libraries/LibWeb/WebGL/WebGLRenderingContextImpl.cpp @@ -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(offset)); }