| 367 | return ret; |
| 368 | } |
| 369 | bv_variable lib_glsl_roundEven(bv_program* prog, u8 count, bv_variable* args) |
| 370 | { |
| 371 | /* round(genType) */ |
| 372 | if (count == 1) { |
| 373 | if (args[0].type == bv_type_object) { |
| 374 | bv_object* vec = bv_variable_get_object(args[0]); |
| 375 | glm::vec4 vecData = glm::roundEven(sd::AsVector<4, float>(args[0])); |
| 376 | |
| 377 | bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count); |
| 378 | bv_object* retObj = bv_variable_get_object(ret); |
| 379 | |
| 380 | for (u16 i = 0; i < retObj->type->props.name_count; i++) |
| 381 | retObj->prop[i] = bv_variable_create_float(vecData[i]); |
| 382 | |
| 383 | return ret; |
| 384 | } |
| 385 | else // cos(scalar) |
| 386 | return bv_variable_create_float(glm::roundEven(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0])))); |
| 387 | } |
| 388 | |
| 389 | return bv_variable_create_float(0.0f); |
| 390 | } |
| 391 | |
| 392 | /* floating-point */ |
| 393 | bv_variable lib_glsl_floatBitsToInt(bv_program* prog, u8 count, bv_variable* args) |
nothing calls this directly
no test coverage detected