There are many combinations of invalid arguments for OpenGL functions and it is impractical to cover all of them.
Even if nothing is wrong with the user,
GL_OUT_OF_MEMORY can also occur in many GL functions due to hardware
problems. They can leave the context in an invalid state which can
result in a reliability or security issue.
Check GL errors after an operation completes and prevent from using the GL context after a GL error occurred.
This merge request also contains several fixes uncovered by checking GL errors.
spec@!opengl firstname.lastname@example.org are marked as crash in
.gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt because they
GL_DOUBLE specification for
glVertexAttribPointer, which is
not supported by OpenGL ES. Avoiding the crashes requires capability
checks on the guest, which this change does not implement.
Signed-off-by: Akihiko Odaki email@example.com