Simplify common type casts in GLSL

Since small integer types are represented as floats, a lot of redundant type
casts were generated (e.g., float(uint8(expr)) -> float(float(expr))).

In some cases, this almost halves the number of temporary variables generated.
Correctly map lerp() to mix intrinsic
Fix indentation
Handle wider range of types when mapping filter Params to uniforms.

For example, uint8_t parameters are stored as float uniforms. This patch
fixed the parameter declaration in the special comment preceding
the shader as well as correctly setting the uniforms at runtime.
GLSL: Improve copy_to_dev and copy_to_host

- don't use GL_UNPACK_ROW_LENGTH, which is unavailable in OpenGL ES
- only transfer directly to/from host buffer if memory is contiguous
- honor min[] values of associated buffer