Log for double precision shaders?

Are there any solutions for log support under double pecision shaders?
I converted a single precision float shader to double precision double shader, but it doesn’t accept some calls to log I have in it.

Convert the argument to float or write your own double-precision log() function. The latter option is likely to be quite slow, and you can’t reasonably leverage the single-precision log() function because it’s only accurate to 3 ULP.

The transcendental functions in sections 8.1 (Angle and Trigonometry Functions) and 8.2 (Exponential Functions) don’t support the use of double-precision types, other than for sqrt() and inversesqrt().

Thanks! That was the trick. Luckily for me the shader code using the log call was still OK with float precision.

For anyone else this means in the double precision shader rather than using doublevar1=log(doublevar2) you can use singlevar1=log(float(doublevar2))

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.