LibWeb/WebGL: Add support for ANGLEInstancedArrays extension

This is only WebGL 1.0 extension. It's enabled in ANGLE by default.

Progress on https://ciechanow.ski/curves-and-surfaces/ that relies on
this extension.
This commit is contained in:
Aliaksandr Kalenik 2024-12-20 11:26:22 +01:00 committed by Alexander Kalenik
commit c9105955f6
Notes: github-actions[bot] 2024-12-20 14:32:52 +00:00
7 changed files with 108 additions and 1 deletions

View file

@ -12,6 +12,7 @@
#include <LibWeb/HTML/HTMLCanvasElement.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/WebGL/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/EventNames.h>
#include <LibWeb/WebGL/OpenGLContext.h>
#include <LibWeb/WebGL/WebGLContextEvent.h>
@ -166,8 +167,11 @@ Optional<Vector<String>> WebGLRenderingContext::get_supported_extensions()
return context().get_supported_extensions();
}
JS::Object* WebGLRenderingContext::get_extension(String const&)
JS::Object* WebGLRenderingContext::get_extension(String const& name)
{
if (name == "ANGLE_instanced_arrays"sv) {
return MUST(ANGLEInstancedArrays::create(realm()));
}
return nullptr;
}