issue #4437: fix crash when doesn't support VAO, and make calculation more precisely.