fix hard coded number of texture targets