mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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
|
@ -30,7 +30,7 @@ interface mixin WebGLRenderingContextOverloads {
|
||||||
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
|
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
|
||||||
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||||
|
|
||||||
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
|
undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
|
||||||
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||||
|
|
||||||
undefined uniform1fv(WebGLUniformLocation? location, Float32List v);
|
undefined uniform1fv(WebGLUniformLocation? location, Float32List v);
|
||||||
|
|
|
@ -555,6 +555,19 @@ public:
|
||||||
continue;
|
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) {
|
if (function.name == "getShaderParameter"sv) {
|
||||||
function_impl_generator.append(R"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
GLint result = 0;
|
GLint result = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue