Why is GLSL log returning the wrong result? (Intel Driver)
<p>I am doing some maths on the GPU and reading the result. </p>

<p>And I am getting the wrong value From log. I have verified this for values 0 - 10, 20, 30, 40. </p>

<p>If I hard code the value (as you can see bellow under verify) I get the right result spat out. However if I use log with the hard coded value that should return the same result, I get the wrong result spat out.</p>

<p>This is the kind of thing I have been doing in my function. </p>

<pre><code>vec4 IScale(vec4 value)
{
    switch(uScaleType_i)
    {
        case Log:

            //value = log(value);

            value = vec4(1,1,1,1);
            value.r = log(5);
            //verifiy
            //value.r = 0.698970004     
        break;
        case Sqrt:
            value = sqrt(value);
        break;
        case None:
            break;
    }
    return value;
}
</code></pre>

<p>I am wondering is there any sense here. I have added the results of what I am getting back into excel and done a graph. At first Its almost like its double the correct value but its not quite that clean, it gets further and further away. </p>

<p>Is there any other explanation for this other than a driver issue? I cant think of anything else to check!</p>

<p>And if so how can i possibly work around it, other than refactoring my code to do it on the CPU? And why can't I find evidence online to back this up? I am completely utterly baffled!</p>

<p>I am running on a laptop with:
 (Intel(R) HD Graphics 4000 with 132 ext.)</p>

<p>p.s. Sqrt is fine and I get the values I would expect.
p.p.s I checked, I have not accidentally created a function called "log" </p>

<p><a href="https://i.stack.imgur.com/V8E2R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V8E2R.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/2Fdf6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Fdf6.png" alt="enter image description here"></a></p>