mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibWeb/WebGL: Account for subarrays in tex(Sub)Image{2D,3D}
This allows Ruffle to correctly upload textures.
This commit is contained in:
parent
49c966b4e7
commit
6bf6cd3f19
Notes:
github-actions[bot]
2025-01-08 14:56:56 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/6bf6cd3f19d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2943 Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 4 additions and 4 deletions
|
@ -692,7 +692,7 @@ public:
|
|||
if (pixels) {
|
||||
auto const& viewed_array_buffer = pixels->viewed_array_buffer();
|
||||
auto const& byte_buffer = viewed_array_buffer->buffer();
|
||||
pixels_ptr = byte_buffer.data();
|
||||
pixels_ptr = byte_buffer.data() + pixels->byte_offset();
|
||||
}
|
||||
glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_ptr);
|
||||
)~~~");
|
||||
|
@ -711,7 +711,7 @@ public:
|
|||
if (src_data) {
|
||||
auto const& viewed_array_buffer = src_data->viewed_array_buffer();
|
||||
auto const& byte_buffer = viewed_array_buffer->buffer();
|
||||
src_data_ptr = byte_buffer.data();
|
||||
src_data_ptr = byte_buffer.data() + src_data->byte_offset();
|
||||
}
|
||||
glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, src_data_ptr);
|
||||
)~~~");
|
||||
|
@ -808,7 +808,7 @@ public:
|
|||
if (pixels) {
|
||||
auto const& viewed_array_buffer = pixels->viewed_array_buffer();
|
||||
auto const& byte_buffer = viewed_array_buffer->buffer();
|
||||
pixels_ptr = byte_buffer.data();
|
||||
pixels_ptr = byte_buffer.data() + pixels->byte_offset();
|
||||
}
|
||||
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels_ptr);
|
||||
)~~~");
|
||||
|
@ -872,7 +872,7 @@ public:
|
|||
if (src_data) {
|
||||
auto const& viewed_array_buffer = src_data->viewed_array_buffer();
|
||||
auto const& byte_buffer = viewed_array_buffer->buffer();
|
||||
pixels_ptr = byte_buffer.data() + src_offset;
|
||||
pixels_ptr = byte_buffer.data() + src_data->byte_offset() + src_offset;
|
||||
}
|
||||
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels_ptr);
|
||||
)~~~");
|
||||
|
|
Loading…
Reference in a new issue