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
The equivalent simplify call with let's enabled is made after the varying attribute expressions are pulled out during codegen.  You are correct that if you enable the OpenGL target feature, and then don't end up doing any OpenGL codegen for some or all funcs, that simplification pass won't be performed.   Also in this case, you will have gone to the trouble of detecting varying attributes, but then never used them.

We may be able to switch to a intrinsic based attribute-tagging mechanism, instead of the fragile name tagging used here and elsewhere, or run a simplify pass that avoids simplifying lets inside .glsl scheduled funcs only.