[Fixed] Seascape corruptions.

Started by Dorian, February 14, 2019, 10:29:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dorian

Hi,

There is a issue on recent Intel graphics (SKL+) on seascape demo.
Screenshot (occurs after couple of seconds): https://imgur.com/a/TiTj1dz

The reason is a float overflow if order of operations is changed by shader compiler.
There is a simple workaround for this by changing one dot operation to use precise float.

Instead of using:
float hash(vec2 p)
{
    float h = dot(p, vec2(127.09999847412109375, 311.70001220703125));
    return fract(sin(h) * 43758.546875);
}

This can be used
float dot_precise(vec2 a, vec2 b)
{
    precise float result = 0;
    result += a.x * b.x;
    result += a.y * b.y;
    return result;
}

float hash(vec2 p)
{
    float h = dot_precise(p, vec2(127.09999847412109375, 311.70001220703125));
    return fract(sin(h) * 43758.546875);
}


in s01-ps.frag.


JeGX

Thanks!
I will update the shader in GPU Caps Viewer (and in the Shadertoy demopack)

Dorian

Thank you JeGX,
I confirm it's fixed in Caps Viewer 1.42.0. :)