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

Function lib_common_ceil

src/CommonLibrary.cpp:1138–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1136 return bv_variable_create_int(0);
1137 }
1138 bv_variable lib_common_ceil(bv_program* prog, u8 count, bv_variable* args)
1139 {
1140 /* ceil(genType) */
1141 if (count == 1) {
1142 if (args[0].type == bv_type_object) { // ceil(vec3), ...
1143 bv_object* vec = bv_variable_get_object(args[0]);
1144 glm::vec4 vecData = glm::ceil(sd::AsVector<4, float>(args[0]));
1145
1146 bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count);
1147 bv_object* retObj = bv_variable_get_object(ret);
1148
1149 for (u16 i = 0; i < retObj->type->props.name_count; i++)
1150 retObj->prop[i] = bv_variable_create_float(vecData[i]);
1151
1152 return ret;
1153 }
1154 else // ceil(scalar)
1155 return bv_variable_create_float(glm::ceil(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0]))));
1156 }
1157
1158 return bv_variable_create_float(0.0f);
1159 }
1160 bv_variable lib_common_clamp(bv_program* prog, u8 count, bv_variable* args)
1161 {
1162 /* clamp(genType, genType, genType), clamp(genType, float, float), also for genIType and genUType */

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected