# Buggy code
def get_2d_smooth_color_shader():
    smooth_2d_vertex_shader = """
    in vec2 pos;
    layout(location=1) in vec4 color;

    uniform mat4 viewProjectionMatrix;
    uniform float x_offset;
    uniform float y_offset;

    out vec4 a_color;

    void main()
    {
        gl_Position = viewProjectionMatrix * vec4(pos.x + x_offset, pos.y + y_offset, 0.0f, 1.0f);
        a_color = color;
    }
    """

    smooth_2d_fragment_shader = """
    in vec4 a_color;

    void main()
    {
        gl_FragColor = a_color;
    }
    """
    return gpu.types.GPUShader(smooth_2d_vertex_shader, smooth_2d_fragment_shader)


# Traceback (Exception)
2020-08-25 10:58:36,292 [ERROR] sverchok.core.update_system: Node Viewer 2D had exception: Shader Compile Error, see console for more details
Traceback (most recent call last):
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/core/update_system.py", line 383, in do_update_general
node.process()
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 813, in process
geom = generate_mesh_geom(config, vecs)
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 478, in generate_mesh_geom
config.v_shader = get_2d_smooth_color_shader()
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 156, in get_2d_smooth_color_shader
return gpu.types.GPUShader(smooth_2d_vertex_shader, smooth_2d_fragment_shader)
Exception: Shader Compile Error, see console for more details
EVENT: node_property_update          IN: SvIcosphereNode           INSTANCE: IcoSphere
GPUShader: compile error:
ERROR: 0:33: Use of undeclared identifier 'gl_FragColor'

2020-08-25 10:58:36,327 [ERROR] sverchok.core.update_system: Node Viewer 2D had exception: Shader Compile Error, see console for more details
Traceback (most recent call last):
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/core/update_system.py", line 383, in do_update_general
node.process()
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 813, in process
geom = generate_mesh_geom(config, vecs)
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 478, in generate_mesh_geom
config.v_shader = get_2d_smooth_color_shader()
File "/Users/jimmygunawan/Library/Application Support/Blender/2.83/scripts/addons/sverchok-master/nodes/viz/viewer_2d.py", line 156, in get_2d_smooth_color_shader
return gpu.types.GPUShader(smooth_2d_vertex_shader, smooth_2d_fragment_shader)
Exception: Shader Compile Error, see console for more details

# Fixed code
def get_2d_smooth_color_shader():
    smooth_2d_vertex_shader = """
    in vec2 pos;
    layout(location=1) in vec4 color;

    uniform mat4 viewProjectionMatrix;
    uniform float x_offset;
    uniform float y_offset;

    out vec4 a_color;

    void main()
    {
        gl_Position = viewProjectionMatrix * vec4(pos.x + x_offset, pos.y + y_offset, 0.0f, 1.0f);
        a_color = color;
    }
    """

    smooth_2d_fragment_shader = """
    in vec4 a_color;

    out vec4 gl_FragColor;
    void main()
    {
        gl_FragColor = a_color;
    }
    """
    return gpu.types.GPUShader(smooth_2d_vertex_shader, smooth_2d_fragment_shader)