mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Implement WebGL getParameter(GL_VERTEX_ARRAY_BINDING)
This commit is contained in:
parent
f373ab7011
commit
b0fcb35134
Notes:
github-actions[bot]
2025-11-27 18:21:05 +00:00
Author: https://github.com/cqundefine
Commit: b0fcb35134
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6744
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/konradekk
3 changed files with 11 additions and 0 deletions
|
|
@ -1208,6 +1208,8 @@ void WebGL2RenderingContextImpl::delete_vertex_array(GC::Root<WebGLVertexArrayOb
|
|||
}
|
||||
|
||||
glDeleteVertexArrays(1, &vertex_array_handle);
|
||||
if (m_current_vertex_array == vertex_array)
|
||||
m_current_vertex_array = nullptr;
|
||||
}
|
||||
|
||||
bool WebGL2RenderingContextImpl::is_vertex_array(GC::Root<WebGLVertexArrayObject> vertex_array)
|
||||
|
|
@ -1239,7 +1241,9 @@ void WebGL2RenderingContextImpl::bind_vertex_array(GC::Root<WebGLVertexArrayObje
|
|||
}
|
||||
array_handle = handle_or_error.release_value();
|
||||
}
|
||||
|
||||
glBindVertexArray(array_handle);
|
||||
m_current_vertex_array = array;
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::compressed_tex_image3d(WebIDL::UnsignedLong target, WebIDL::Long level, WebIDL::UnsignedLong internalformat, WebIDL::Long width, WebIDL::Long height, WebIDL::Long depth, WebIDL::Long border, GC::Root<WebIDL::ArrayBufferView> src_data, WebIDL::UnsignedLongLong src_offset, WebIDL::UnsignedLong src_length_override)
|
||||
|
|
|
|||
|
|
@ -1526,6 +1526,11 @@ JS::Value WebGLRenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
|
|||
glGetIntegervRobustANGLE(GL_UNPACK_SKIP_ROWS, 1, nullptr, &result);
|
||||
return JS::Value(result);
|
||||
}
|
||||
case GL_VERTEX_ARRAY_BINDING: { // FIXME: Allow this for VERTEX_ARRAY_BINDING_OES
|
||||
if (!m_current_vertex_array)
|
||||
return JS::js_null();
|
||||
return JS::Value(m_current_vertex_array);
|
||||
}
|
||||
case MAX_CLIENT_WAIT_TIMEOUT_WEBGL:
|
||||
// FIXME: Make this an actual limit
|
||||
return JS::js_infinity();
|
||||
|
|
@ -2312,6 +2317,7 @@ void WebGLRenderingContextImpl::visit_edges(JS::Cell::Visitor& visitor)
|
|||
visitor.visit(m_transform_feedback_binding);
|
||||
visitor.visit(m_pixel_pack_buffer_binding);
|
||||
visitor.visit(m_pixel_unpack_buffer_binding);
|
||||
visitor.visit(m_current_vertex_array);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ protected:
|
|||
GC::Ptr<WebGLTexture> m_texture_binding_2d_array;
|
||||
GC::Ptr<WebGLTexture> m_texture_binding_3d;
|
||||
GC::Ptr<WebGLTransformFeedback> m_transform_feedback_binding;
|
||||
GC::Ptr<WebGLVertexArrayObject> m_current_vertex_array;
|
||||
|
||||
NonnullOwnPtr<OpenGLContext> m_context;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue