MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / lib_common_length

Function lib_common_length

src/CommonLibrary.cpp:2364–2378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2362 return bv_variable_create_float(0.0f);
2363 }
2364 bv_variable lib_common_length(bv_program* prog, u8 count, bv_variable* args)
2365 {
2366 /* float length(genType) */
2367 bv_variable ret = bv_variable_create_float(0.0f);
2368 if (args[0].type == bv_type_object) {
2369 glm::vec4 x = sd::AsVector<4, float>(args[0]);
2370 bv_variable_set_float(&ret, glm::length(x));
2371 }
2372 else {
2373 float x = bv_variable_get_float(bv_variable_cast(bv_type_float, args[0]));
2374 bv_variable_set_float(&ret, glm::length(x));
2375 }
2376
2377 return ret;
2378 }
2379 bv_variable lib_common_normalize(bv_program* prog, u8 count, bv_variable* args)
2380 {
2381 /* genType normalize(genType) */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected