The size of gles GL_ARRAY_BUFFER has changed unexpectedly

The goal is to create a buffer pool to alleviate the stuttering caused by creating/destroying buffers.

The general idea is to first allocate a large buffer (using glBufferData), and then perform sub-allocation (using glMapBufferRange).

In practice, we allocated an 8MB buffer using glBufferData, then performed sub-allocation via glMapBufferRange, with each sub-allocation being 8KB.

During the process, it was observed that this 8MB buffer suddenly shrank to less than 1MB at a certain stage, causing glMapBufferRangeto fail.

The buffer size is obtained using glGetBufferParameterivin conjunction with GL_BUFFER_SIZE.

We have self-checked the application and confirmed that no glBufferDatacalls have been made to modify the buffer size. Could you suggest any methods or tools to diagnose why the buffer suddenly shrank?

Parents Reply Children