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

Function lib_glsl_roundEven

src/GLSLLibrary.cpp:369–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected