How to handle GL_OUT_OF_MEMORY error during glBufferData?

OpenGL link mentions error GL_OUT_OF_MEMORY

The state of GL is undefined, except for the state of the error flags after writing this error.

A function glBufferDatamay generate this error if it cannot digest the data. But, on the other hand, the API does not seem to be able to check whether it will be possible to send data of a certain size.

Is this situation really hopeless? If I get this error, I can only recreate the whole context of OpenGL and start all over again?

+4
source share
1 answer

, malloc NULL new ? ?

. , malloc NULL / new . , .

OpenGL. , -, ; . , - , .

, , OpenGL -.

, , OpenGL undefined OUT_OF_MEMORY : OOM . , OOM, ​​.

() . ( ) . , OOM OpenGL, , OOM.

, , glBufferData, , OpenGL ? OOM , .

, , . - .

, API- , Vulkan D3D12, OOM, .

:

, , API, , , .

. ?

GPU; . . , .

, , , OpenGL , , , .

, Vulkan API , ( , ). ; , , , .

+14

Source: https://habr.com/ru/post/1619369/


All Articles