mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/WebGL: Implement getActiveAttrib() and getActiveUniform()
This commit is contained in:
parent
f3a24d1569
commit
3c2ac309ca
Notes:
github-actions[bot]
2024-12-03 22:36:52 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 3c2ac309ca
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2688
Reviewed-by: https://github.com/ADKaster ✅
5 changed files with 67 additions and 7 deletions
|
@ -352,6 +352,34 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "getActiveUniform"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
GLint size = 0;
|
||||
GLenum type = 0;
|
||||
GLsizei buf_size = 256;
|
||||
GLsizei length = 0;
|
||||
GLchar name[256];
|
||||
glGetActiveUniform(program->handle(), index, buf_size, &length, &size, &type, name);
|
||||
auto readonly_bytes = ReadonlyBytes { name, static_cast<size_t>(length) };
|
||||
return WebGLActiveInfo::create(m_realm, String::from_utf8_without_validation(readonly_bytes), type, size);
|
||||
)~~~");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "getActiveAttrib"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
GLint size = 0;
|
||||
GLenum type = 0;
|
||||
GLsizei buf_size = 256;
|
||||
GLsizei length = 0;
|
||||
GLchar name[256];
|
||||
glGetActiveAttrib(program->handle(), index, buf_size, &length, &size, &type, name);
|
||||
auto readonly_bytes = ReadonlyBytes { name, static_cast<size_t>(length) };
|
||||
return WebGLActiveInfo::create(m_realm, String::from_utf8_without_validation(readonly_bytes), type, size);
|
||||
)~~~");
|
||||
continue;
|
||||
}
|
||||
|
||||
Vector<ByteString> gl_call_arguments;
|
||||
for (size_t i = 0; i < function.parameters.size(); ++i) {
|
||||
auto const& parameter = function.parameters[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue