2022-11-23 19:57:00 +00:00
|
|
|
struct frexp_result_f32 {
|
2022-11-23 18:21:38 +00:00
|
|
|
float fract;
|
|
|
|
int exp;
|
|
|
|
};
|
2022-11-23 19:57:00 +00:00
|
|
|
frexp_result_f32 tint_frexp(float param_0) {
|
2022-11-23 18:21:38 +00:00
|
|
|
float exp;
|
2023-03-16 21:31:15 +00:00
|
|
|
float fract = sign(param_0) * frexp(param_0, exp);
|
2022-11-23 19:57:00 +00:00
|
|
|
frexp_result_f32 result = {fract, int(exp)};
|
2022-11-23 18:21:38 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main() {
|
|
|
|
const float runtime_in = 1.25f;
|
2022-11-23 19:57:00 +00:00
|
|
|
frexp_result_f32 res = {0.625f, 1};
|
2022-11-23 18:21:38 +00:00
|
|
|
res = tint_frexp(runtime_in);
|
2022-11-23 19:57:00 +00:00
|
|
|
const frexp_result_f32 c = {0.625f, 1};
|
2022-11-23 18:21:38 +00:00
|
|
|
res = c;
|
|
|
|
const float fract = res.fract;
|
|
|
|
const int exp = res.exp;
|
|
|
|
return;
|
|
|
|
}
|