LibWeb/WebGL: Implement texImage2D()

This commit is contained in:
Aliaksandr Kalenik
2024-12-02 20:40:16 +01:00
committed by Alexander Kalenik
parent 3c2ac309ca
commit 64fec8b2de
Notes: github-actions[bot] 2024-12-03 22:36:45 +00:00
3 changed files with 33 additions and 5 deletions

View File

@@ -263,6 +263,19 @@ public:
continue;
}
if (function.name == "texImage2D"sv && function.overload_index == 0) {
function_impl_generator.append(R"~~~(
void const* pixels_ptr = nullptr;
if (pixels) {
auto const& viewed_array_buffer = pixels->viewed_array_buffer();
auto const& byte_buffer = viewed_array_buffer->buffer();
pixels_ptr = byte_buffer.data();
}
glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_ptr);
)~~~");
continue;
}
if (function.name == "getShaderParameter"sv) {
function_impl_generator.append(R"~~~(
GLint result = 0;