mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb/WebGL: Return from uniform methods if location is null
If location is null, the spec simply tells us to return and ignore the passed in data. Fixes #3708.
This commit is contained in:
parent
b11ba4cc90
commit
6cb0f41c57
Notes:
github-actions[bot]
2025-03-03 07:44:34 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/6cb0f41c571 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3771 Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 9 additions and 0 deletions
|
@ -1448,7 +1448,11 @@ public:
|
|||
function_impl_generator.set("array_argument_name", "data");
|
||||
}
|
||||
|
||||
// "If the passed location is null, the data passed in will be silently ignored and no uniform variables will be changed."
|
||||
function_impl_generator.append(R"~~~(
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
auto matrix_size = @number_of_matrix_elements@ * @number_of_matrix_elements@;
|
||||
float const* raw_data = nullptr;
|
||||
u64 count = 0;
|
||||
|
@ -1501,7 +1505,12 @@ public:
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
function_impl_generator.set("number_of_vector_elements", number_of_vector_elements);
|
||||
|
||||
// "If the passed location is null, the data passed in will be silently ignored and no uniform variables will be changed."
|
||||
function_impl_generator.append(R"~~~(
|
||||
if (!location)
|
||||
return;
|
||||
|
||||
@cpp_element_type@ const* data = nullptr;
|
||||
size_t count = 0;
|
||||
if (v.has<Vector<@cpp_element_type@>>()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue