Skip to content

Conversation

miselin
Copy link

@miselin miselin commented Jun 20, 2017

I noticed when profiling my code that glm::fastLength's usage of glm::fastInverseSqrt pulls in the generic detail::compute_inversesqrt, which just calls out to sqrtf(). This was the case regardless of the precision of the vectors involved.

This change resolves that, by ensuring for usage with type float that the optimized detail::compute_inversesqrt specialization is used. With this change, no call is made to sqrtf() when calling glm::fastInverseSqrt.

I also noticed that the version under ifdef __CUDACC__ already seemed to use lowp so this also brings the two cases closer together in terms of implementation.

@Groovounet Groovounet self-assigned this Jun 23, 2017
@Groovounet Groovounet added this to the GLM 0.9.9 milestone Jun 23, 2017
@Groovounet Groovounet merged commit 23a7c78 into g-truc:master Jun 23, 2017
@Groovounet
Copy link
Member

Thanks for contributing!
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants