mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL: Return null from getUniformLocation if uniform isn't found
This commit is contained in:
parent
5632a52531
commit
008699c129
Notes:
github-actions[bot]
2025-10-25 10:57:42 +00:00
Author: https://github.com/Lubrsi
Commit: 008699c129
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6558
2 changed files with 18 additions and 2 deletions
|
|
@ -1649,7 +1649,15 @@ GC::Root<WebGLUniformLocation> WebGLRenderingContextImpl::get_uniform_location(G
|
|||
}
|
||||
|
||||
auto name_null_terminated = null_terminated_string(name);
|
||||
return WebGLUniformLocation::create(m_realm, glGetUniformLocation(program_handle, name_null_terminated.data()));
|
||||
|
||||
// "This function returns -1 if name does not correspond to an active uniform variable in program or if name starts
|
||||
// with the reserved prefix "gl_"."
|
||||
// WebGL Spec: The return value is null if name does not correspond to an active uniform variable in the passed program.
|
||||
auto location = glGetUniformLocation(program_handle, name_null_terminated.data());
|
||||
if (location == -1)
|
||||
return nullptr;
|
||||
|
||||
return WebGLUniformLocation::create(m_realm, location);
|
||||
}
|
||||
|
||||
void WebGLRenderingContextImpl::hint(WebIDL::UnsignedLong target, WebIDL::UnsignedLong mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue