As a C++ programmer, I always have in mind that “new” may throw and malloc() may return 0, because of OUT OF MEMORY.
I check glBindTexture(), glTexStorage*() and glTexSubImage*().
Every returning error, is basically a bad parameter error.
Where is runtime errors like OUT OF GPU TEXTURE MEMORY?
PS: My textures are very small, but I am curious.
No functions are stated to return GL_OUT_OF_MEMORY, because any OpenGL function can do so.
GPU memory is not necessarily allocated when you ask for it to be. Implementations are permitted to defer such allocations whenever they want. There’s really not much you can do if you ever get such an error anyway, since you can’t track down what caused it. You also can’t tell what resulted from it, since any function that issues that error has undefined behavior.