mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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: 6cb0f41c57
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");
|
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"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
|
if (!location)
|
||||||
|
return;
|
||||||
|
|
||||||
auto matrix_size = @number_of_matrix_elements@ * @number_of_matrix_elements@;
|
auto matrix_size = @number_of_matrix_elements@ * @number_of_matrix_elements@;
|
||||||
float const* raw_data = nullptr;
|
float const* raw_data = nullptr;
|
||||||
u64 count = 0;
|
u64 count = 0;
|
||||||
|
@ -1501,7 +1505,12 @@ public:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
function_impl_generator.set("number_of_vector_elements", number_of_vector_elements);
|
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"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
|
if (!location)
|
||||||
|
return;
|
||||||
|
|
||||||
@cpp_element_type@ const* data = nullptr;
|
@cpp_element_type@ const* data = nullptr;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
if (v.has<Vector<@cpp_element_type@>>()) {
|
if (v.has<Vector<@cpp_element_type@>>()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue