LibWeb/WebGL2: Implement EXT_color_buffer_float extension

This makes the Point Of Sale model on https://www.shopify.com/ have
colour instead of being completely black.
This commit is contained in:
Luke Wilde 2025-03-05 17:13:52 +00:00 committed by Andreas Kling
parent 31853c13d3
commit 9ca25eed7f
Notes: github-actions[bot] 2025-03-06 12:00:25 +00:00
8 changed files with 99 additions and 0 deletions

View file

@ -15,6 +15,7 @@
#include <LibWeb/Infra/Strings.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/WebGL/EventNames.h>
#include <LibWeb/WebGL/Extensions/EXTColorBufferFloat.h>
#include <LibWeb/WebGL/Extensions/WebGLCompressedTextureS3tc.h>
#include <LibWeb/WebGL/OpenGLContext.h>
#include <LibWeb/WebGL/WebGL2RenderingContext.h>
@ -73,6 +74,7 @@ void WebGL2RenderingContext::visit_edges(Cell::Visitor& visitor)
Base::visit_edges(visitor);
WebGL2RenderingContextImpl::visit_edges(visitor);
visitor.visit(m_canvas_element);
visitor.visit(m_ext_color_buffer_float_extension);
visitor.visit(m_webgl_compressed_texture_s3tc_extension);
}
@ -180,6 +182,15 @@ JS::Object* WebGL2RenderingContext::get_extension(String const& name)
return m_webgl_compressed_texture_s3tc_extension;
}
if (Infra::is_ascii_case_insensitive_match(name, "EXT_color_buffer_float"sv)) {
if (!m_ext_color_buffer_float_extension) {
m_ext_color_buffer_float_extension = MUST(Extensions::EXTColorBufferFloat::create(realm(), *this));
}
VERIFY(m_ext_color_buffer_float_extension);
return m_ext_color_buffer_float_extension;
}
return nullptr;
}