You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that this function has different results depending on whether or not #[inline(always)] is used:
/// Return `1.0` when `value` is less than or equal to `edge`/// and `0.0` when `value` is greater than `edge`.#[inline(always)]pubfnstep_le(value:f32,edge:f32) -> f32{((value <= edge)asu32)asf32}
I have a shader you can see here that uses this function.
Expected Behaviour
Using ((sphere_aabb.max.z <= 1.0) as u32) as f32, which is a manual inlining of the body of the function, produces the expected results.
Using crate::math::step_le(sphere_aabb.max.z, 1.0) while having an #[inline(always)] annotation on step_le produces the expected results.
Using crate::math::step_le(sphere_aabb.max.z, 1.0)without having an #[inline(always)] annotation on step_le produces the opposite of the expected result.
Example & Steps To Reproduce
I can work on a minimal reproducible shader.
The text was updated successfully, but these errors were encountered:
It seems that this function has different results depending on whether or not
#[inline(always)]
is used:I have a shader you can see here that uses this function.
Expected Behaviour
Using
((sphere_aabb.max.z <= 1.0) as u32) as f32
, which is a manual inlining of the body of the function, produces the expected results.Using
crate::math::step_le(sphere_aabb.max.z, 1.0)
while having an#[inline(always)]
annotation onstep_le
produces the expected results.Using
crate::math::step_le(sphere_aabb.max.z, 1.0)
without having an#[inline(always)]
annotation onstep_le
produces the opposite of the expected result.Example & Steps To Reproduce
I can work on a minimal reproducible shader.
The text was updated successfully, but these errors were encountered: