GLSL Varying Attributes

The OpenGL GLSL target will run a Halide Func on a screen filling quad inside the fragment shader of a GLSL program. This branch adds passes during lowering and GLSL codegen to identify linear expressions that may be pulled out of the fragment shader. These expressions are evaluated per-vertex, as varying attributes, and then interpolated across the image by the GPU. The branch also contains changes to pack scalar parameters into vec4 uniform and varying attributes.

The code in this branch will interact with the specialized_branched_loops branch, to support piecewise linear expressions.  It will also interact with the upcoming GPU runtime API refactoring.

PTAL
I leave this up to you, but I feel like this logic:

if (for_loops.size() == 2) {
    // Ensure this is the innermost GPU thread loop.
    const For *nested_for = op->body.as<For>();
    internal_assert(!(nested_for && CodeGen_GPU_Dev::is_gpu_var(nested_for->name)));

is a bit more air-tight. What you have is probably fine though, so consider this just a suggestion.