OpenGL performance of persistent mapped buffers with READ_BIT

Hi!

Would there be a performance difference for a persistent mapped buffer between the two following mapping bit flags:

-  GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT

-  GL_MAP_WRITE_BIT GL_MAP_READ_BIT | GL_MAP_UNSYNCHRONIZED_BIT

If there is a performance difference - in what scenarios it could be seen?

Regards,
Aleksei

Parents
  • The read/write bits on the mapping are ignored and it shouldn't make any difference - the memory has already been allocated by that point. 

    In the Mali drivers, by default buffers are allocated and mapped to bypass the CPU cache. 

    If you want to cache buffers on the CPU for faster CPU-side reads, ensure the memory allocation (e.g. via glBufferData) is allocated via the UNPACK_BUFFER binding. 

    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, bindIndex);
    glBufferData(GL_PIXEL_UNPACK_BUFFER, size, nullptr, GL_DYNAMIC_READ);


    Cheers, 
    Pete

Reply
  • The read/write bits on the mapping are ignored and it shouldn't make any difference - the memory has already been allocated by that point. 

    In the Mali drivers, by default buffers are allocated and mapped to bypass the CPU cache. 

    If you want to cache buffers on the CPU for faster CPU-side reads, ensure the memory allocation (e.g. via glBufferData) is allocated via the UNPACK_BUFFER binding. 

    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, bindIndex);
    glBufferData(GL_PIXEL_UNPACK_BUFFER, size, nullptr, GL_DYNAMIC_READ);


    Cheers, 
    Pete

Children
No data