profile
viewpoint

Ask questions.abs() and .signum() cause 64-bit integer instruction generation

This is arguably not rust-gpu's fault, but num-traits, but it'll happen again, so we need a record of it.

Using vector abs ends up generating 64-bit ops due to https://github.com/rust-num/num-traits/blob/47d69223ce7707ebbf8a91c3e6b3997e48653feb/src/float.rs#L762 .

Also see the following image:

image

Ideally of course, abs should just generate a SPIR-V abs instruction instead of doing bithacks.

EmbarkStudios/rust-gpu

Answer questions XAMPPRocky

…and I don't believe copysign exists in num-traits for some reason.

@khyperia I opened a PR for it awhile ago https://github.com/rust-num/num-traits/pull/207. I've sent them a friendly ping to look at it again.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List