Question

I am attempting to fix one performance issue about glMapBufferRange. Our code does stream drawing using VBO and glMapBufferRange on iPad4 running iOS 6.x. The pattern is something like:

Map(first sub region) -> Write data to the 1st sub region -> Unmap -> Map( second sub region)->Write data to the 2nd sub region ->UnMap... If the buffer is full, draw the buffer and restart to fill data from the beginning.

The instrument says there are some GPU waits on glMapBufferRange. I look into our code and reference to the API manual. I set the access flag of glMapBufferRange to GL_MAP_WRITE_BIT | GL_MAP_INVALIDATA_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT. However, GL_MAP_UNSYNCHRONIZED_BIT is ignored according to the instrument. The performance is the same no matter GL_MAP_UNSYNCHRONIZED_BIT is set or not.

Does anyone know why? Any suggestion to improve this use case?

Thanks, Wallace

Was it helpful?

Solution

The flag turns out to be working. I forgot to add the flag when mapping the index buffers. The performance issue is fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top