spraff
spraff

Reputation: 33405

Can out of memory errors be detected for glTexImage?

Since, for example, glBufferData can report an GL_OUT_OF_MEMORY error, I expected glTexImage to do so to, but it doesn't.

Presumably it is possible to run out of texture memory, so how do I detect the event?

Upvotes: 0

Views: 106

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473537

Any OpenGL function can theoretically result in a GL_OUT_OF_MEMORY error, if as a side effect of some process, memory needs to be allocated but cannot. As stated by GL 4.4 core profile, section 2.3:

The Specification attempts to explicitly describe these implicit error conditions (with the exception of OUT_OF_MEMORY) wherever they apply

So the error descriptions don't have to say that GL_OUT_OF_MEMORY can happen. It always can. Though it is odd that they're inconsistent about it, specifically calling out the possibility in certain cases but not others.

Upvotes: 2

Related Questions