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

Function lib_glsl_umulExtended

src/GLSLLibrary.cpp:1501–1538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1499 return bv_variable_create_uint(0);
1500 }
1501 bv_variable lib_glsl_umulExtended(bv_program* prog, u8 count, bv_variable* args)
1502 {
1503 /* umulExtended */
1504 if (count >= 4) {
1505 if (args[0].type == bv_type_object) {
1506 glm::uvec4 xData = sd::AsVector<4, unsigned int>(args[0]);
1507 glm::uvec4 yData = sd::AsVector<4, unsigned int>(args[1]);
1508
1509 glm::uvec4 msb, lsb;
1510 glm::umulExtended(xData, yData, msb, lsb);
1511
1512 bv_variable* outMSB = bv_variable_get_pointer(args[2]);
1513 bv_object* outMSBObj = bv_variable_get_object(*outMSB);
1514 for (u16 i = 0; i < outMSBObj->type->props.name_count; i++)
1515 outMSBObj->prop[i] = bv_variable_create_uint(msb[i]);
1516
1517 bv_variable* outLSB = bv_variable_get_pointer(args[3]);
1518 bv_object* outLSBObj = bv_variable_get_object(*outLSB);
1519 for (u16 i = 0; i < outLSBObj->type->props.name_count; i++)
1520 outLSBObj->prop[i] = bv_variable_create_uint(lsb[i]);
1521 }
1522 else {
1523 unsigned int x = bv_variable_get_uint(args[0]);
1524 unsigned int y = bv_variable_get_uint(args[1]);
1525
1526 unsigned int msb = 0, lsb = 0;
1527 glm::umulExtended(x, y, msb, lsb);
1528
1529 bv_variable* outMSB = bv_variable_get_pointer(args[2]);
1530 bv_variable_set_uint(outMSB, msb);
1531
1532 bv_variable* outLSB = bv_variable_get_pointer(args[3]);
1533 bv_variable_set_uint(outLSB, lsb);
1534 }
1535 }
1536
1537 return bv_variable_create_void();
1538 }
1539 bv_variable lib_glsl_imulExtended(bv_program* prog, u8 count, bv_variable* args)
1540 {
1541 /* imulExtended */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected