Created attachment 8504424 [details] [diff] [review] Catch GL errors This is something that we've long been doing for texImage2D, see CheckedTexImage2D. Forgot to do the same for texStorage entry points.
Really we should assert that the only errors are NO_ERROR or OUT_OF_MEMORY. Any other error should be considered invalid at this time.
Hrm, that would mean asserting on driver bugs. For example, after we have validated that a texStorage call is valid, a buggy driver could still reject it with, say, INVALID_OPERATION. Not sure that we would want to crash debug builds on that, given that our state tracking is already resilient to such driver bugs, with this patch.