Skip to content
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

Use correct precision for detail::compute_inversesqrt in glm::fastInverseSqrt #640

Merged
merged 1 commit into from
Jun 23, 2017

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