Move more draw call validation to the API.

The GL expects us to reject invalid draw calls before we start
doing any work, so we can prevent internal unnecessary state
changes.

Also update the program binary's cached sampler data when we
validate. The previous patch was breaking draw calls in Google
Earth WebGL.

BUG=angle:571
BUG=390412

Change-Id: I1c4e204ae2467afc36b76af975a3a49e26349639
Reviewed-on: https://chromium-review.googlesource.com/206482
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
6 files changed