-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
u32::max
/ u32::min
require OpCapability U8
#147
Comments
Wouldn't that mean it takes more space on devices that support OpCapability U8? |
Used within a shader not much would change, the registers are (usually) 32bit anyway and you'd want to do the actual comparison directly afterwards anyway to reduce it to bools, which on many platforms have more compact storage. (eg. on AMD they represent bools by bits in a scalar register instead of using vector registers.) |
What about a way simpler solution: Overwrite the method pub fn clamp(mut self, min: f32, max: f32) -> f32 {
assert!(min <= max, "min > max, or either was NaN. min = {min:?}, max = {max:?}");
if self < min {
self = min;
}
if self > max {
self = max;
}
self
} |
What do we lose with that? I assume nothing? |
Exactly, it would just make those common methods work without breaking anything else. Now everything using |
I assume the impl with Ordinal is there for a reason, so perhaps we could even switch back to that when |
u32::max
/u32::min
cannot be used as they requireOpCapability U8
. They should just work out of the box.Workaround: use
u32::clamp()
instead.Maybe we should special case the Ordering enum to be a u32?The text was updated successfully, but these errors were encountered: