mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb/WebGL: Implement texSubImage2D with ArrayBufferView
This commit is contained in:
parent
7a6b6627e9
commit
5392aabded
Notes:
github-actions[bot]
2024-12-05 20:42:11 +00:00
Author: https://github.com/Lubrsi
Commit: 5392aabded
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2791
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/shannonbooth
2 changed files with 14 additions and 1 deletions
|
@ -555,6 +555,19 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "texSubImage2D"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();
|
||||
}
|
||||
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels_ptr);
|
||||
)~~~");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "getShaderParameter"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
GLint result = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue