PDA

View Full Version : Where is OUT OF MEMORY when allocate textures?



Gessos Paul
05-30-2016, 12:59 PM
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.

Alfonse Reinheart
05-30-2016, 01:15 PM
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.