         video_y = VIDEO_BUFFER_LINES - 2;
     }
 
+    float x_mix;
+    float y_mix;
+
     switch (OPTION_VIDEO_FILTER)
     {
         case VIDEO_FILTER_LINEAR:
-
-            float x_mix = float (mod_x) / float (scale);
-            float y_mix = float (mod_y) / float (scale);
+            x_mix = float (mod_x) / float (scale);
+            y_mix = float (mod_y) / float (scale);
 
             /* Fetch the four pixels to interpolate between */
             vec4 pixel_tl = get_pixel (video_x,     video_y    );

uniform ivec3 options; /* x = video_filter, y = show_border, z = blank_left */
uniform int scale;

vec4 get_pixel (int x, int y)
{
    bool active_area;

    return BLACK;
}


/*
 * Given a line number, return the portion of light that is allowed
 * to pass through when the scanline filter is enabled.
 */
float scanline_mix (int line)
{
    int t; /* Thickness of the shading at the top and bottom of each scanline. */

    if (scale > 4)
    {
        t = scale / 4;
    }
    else
    {
        t = 1;
    }

    switch (scale)
    {
        /* Hard-coded values for lower resolutions. */
        case 1:
            return 0.75;
        case 2:
            return 1.0 - float (line) * 0.5;

        default:
            /* Ramp up, average brightness = 0.625 */
            if (line < t)
            {
                float position = (float (line) + 0.5) / float (t);
                float mix = 0.25 + position * 0.75;

                return smoothstep (0.0, 1.0, mix);
            }
            /* Constant, average brightness = 1.0 */
            if (line < (t + (scale - 2 * t)))
            {
                return 1.0;
            }
            /* Ramp down, average brightness = 0.625 */
            else
            {
                float position = (float (line - (scale - t)) + 0.5) / float (t);
                float mix = 1.0 - position * 0.75;

                return smoothstep (0.0, 1.0, mix);
            }
    }
}


/*
 * Entry point for fragment shader.
 */
void main()
{
    /* Screen location of this fragment. */
