Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
22657 Discussions

OpenGL GLSL sin, cos, and sqrt precision on Intel HD 5000

MJone15
Beginner
3,833 Views

What is the maximum, actual precision of the sin, cos, and sqrt functions on an Intel HD 5000? I am working with a Surface Pro 3.

I have a calculation in a shader which generates a cartesian position from a WGS84 location.

The result is off by about 0.00001 radians. This would seem to suggest that Intel's trig precision is the bottom of the barrel for GLSL support -- 1/100000.

This function works perfectly on an ancient NVidia Geforce 8400 GS. The exact same shader, with the same inputs, produces an output with an undesirable offset.

I need to know the precision to know whether I just have to avoid Intel cards entirely.

I may be able to provide more info as needed, but I need to use this as a starting point.

Alternatively, are there any caveats or gotchyas with Intel GLSL math, as opposed to NVidias, that someone might know of?

0 Kudos
3 Replies
ROBERT_U_Intel
Employee
2,566 Views

Hi Michael

I am looking into your questions and will report back on this thread soon.

Thanks

Robert

0 Kudos
MJone15
Beginner
2,566 Views

Thanks.

I tried double precision in the shader, which only works for sqrt, and it had no effect. So that might zero it in on the cos/sin.

I actually think the float type has higher precision than the NVidia card, but I can't easily confirm that. But the ellipsoid math is producing an incorrect result.

Note that the angles are all between -PI and PI. Most experiments are between 0 and PI or 0 and PI/2.

0 Kudos
ROBERT_U_Intel
Employee
2,566 Views

Hi Michael

Yes, you are correct – double precision sin/cos functions are not present in GLSL.

Maybe 'precise' qualifier will help. It tells compiler not to optimize math expressions (for example, do not replace 'x /y' with 'x * rcp(y)').

Thanks

Robert

0 Kudos
Reply