danilw

AMD Vulkan driver SPIR-V shader Very critical bug

Discussion created by danilw on Mar 20, 2020
Latest reply on Mar 23, 2020 by Andrey2007AMD

hardware AMD Vega 8

 

1. This is not hardware bug, why - because this shader work without problems in same AMD hardware in OpenGL.

2. This bug does ruin all if/else/for loops/etc inside of loops and this can not be fixed by code.

3. Bug ruin any shader whole logic, Vulkan return "Device lost" or "Wait for fence failed" errors.

4. Example application(exe) download link with this shader.

 

Bug(GLSL shader code):

void AMD_loop_bug() {
    for (int k = 0 ; k < 1; k++) {
        for (int i = 0 ; i < 1; i++) {
           
            if(i<1000)break; //FIRST part of bug
           
            for (int j = 0 ; j < 1; j++) {
                if (true)return; //SECOND part of bug
            }
        }
        if (true)break; //THIRD part of bug, comment any of parts and bug gone
    }
}

call AMD_loop_bug() from any shader, and it will ruin application.

 

This bug ruin my big shader logic shadertoy link, this shader work only in OpenGL mode in AMD...

Vulkan version link can not be launched in AMD because of this bug. (it launched and work for first 5 sec, till shader loop logic start)

Outcomes