mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWeb/WebGL2: Implement texImage2D with ArrayBufferView and offset
This commit is contained in:
parent
766f4d2ec4
commit
50b4d65540
Notes:
github-actions[bot]
2024-12-14 08:09:20 +00:00
Author: https://github.com/Lubrsi
Commit: 50b4d65540
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2905
2 changed files with 14 additions and 1 deletions
|
@ -30,7 +30,7 @@ interface mixin WebGL2RenderingContextOverloads {
|
||||||
// May throw DOMException
|
// May throw DOMException
|
||||||
[FIXME] undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, TexImageSource source);
|
[FIXME] undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, TexImageSource source);
|
||||||
|
|
||||||
[FIXME] undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, unsigned long long srcOffset);
|
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, unsigned long long srcOffset);
|
||||||
|
|
||||||
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr pboOffset);
|
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr pboOffset);
|
||||||
|
|
||||||
|
|
|
@ -657,6 +657,19 @@ public:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (webgl_version == 2 && function.name == "texImage2D"sv && function.overload_index == 2) {
|
||||||
|
function_impl_generator.append(R"~~~(
|
||||||
|
void const* pixels_ptr = nullptr;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_ptr);
|
||||||
|
)~~~");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (function.name == "texSubImage2D"sv && function.overload_index == 0) {
|
if (function.name == "texSubImage2D"sv && function.overload_index == 0) {
|
||||||
function_impl_generator.append(R"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
void const* pixels_ptr = nullptr;
|
void const* pixels_ptr = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue