wined3d: Reduce code duplication in shader_glsl_to_ functions.