refactor gl detection of attributes from capabilities