Glsl select tests

Includes tests for Select in -opengl targets as well as a fix for select, and a fix for bug #516