gl2: split queryGraphicsState in two.