Using subroutines to select shader functionality