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

Function lib_common_exp

src/CommonLibrary.cpp:1367–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1365 return bv_variable_create_float(0.0f);
1366 }
1367 bv_variable lib_common_exp(bv_program* prog, u8 count, bv_variable* args)
1368 {
1369 /* exp(genType) */
1370 if (count == 1) {
1371 if (args[0].type == bv_type_object) { // exp(vec3), ...
1372 bv_object* vec = bv_variable_get_object(args[0]);
1373 glm::vec4 vecData = glm::exp(sd::AsVector<4, float>(args[0]));
1374
1375 bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count);
1376 bv_object* retObj = bv_variable_get_object(ret);
1377
1378 for (u16 i = 0; i < retObj->type->props.name_count; i++)
1379 retObj->prop[i] = bv_variable_create_float(vecData[i]);
1380
1381 return ret;
1382 }
1383 else // exp(scalar)
1384 return bv_variable_create_float(glm::exp(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0]))));
1385 }
1386
1387 return bv_variable_create_float(0.0f);
1388 }
1389 bv_variable lib_common_exp2(bv_program* prog, u8 count, bv_variable* args)
1390 {
1391 /* exp2(genType) */

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected