| 71 | return bv_variable_create_void(); |
| 72 | } |
| 73 | bv_variable lib_hlsl_clip(bv_program* prog, u8 count, bv_variable* args) |
| 74 | { |
| 75 | bool shouldDiscard = false; |
| 76 | |
| 77 | if (count == 1) { |
| 78 | if (args[0].type == bv_type_object) { // acosh(vec3), ... |
| 79 | bv_object* vec = bv_variable_get_object(args[0]); |
| 80 | glm::vec4 vecData = sd::AsVector<4, float>(args[0]); // acosh takes only float vectors |
| 81 | |
| 82 | for (u16 i = 0; i < vec->type->props.name_count; i++) |
| 83 | shouldDiscard |= (vecData[i] < 0.0f); |
| 84 | } |
| 85 | else // acosh(scalar) |
| 86 | shouldDiscard = (bv_variable_get_float(bv_variable_cast(bv_type_float, args[0])) < 0.0f); |
| 87 | } |
| 88 | |
| 89 | if (shouldDiscard) |
| 90 | ((sd::ShaderDebugger*)prog->user_data)->SetDiscarded(true); |
| 91 | |
| 92 | return bv_variable_create_void(); |
| 93 | } |
| 94 | |
| 95 | /* math */ |
| 96 | bv_variable lib_hlsl_saturate(bv_program* prog, u8 count, bv_variable* args) |
nothing calls this directly
no test coverage detected