The docs for
glMapNamedBufferRange list several optional flags that can be used when a buffer is mapped such as
The docs say:
The following optional flag bits in access may be used to modify the mapping: GL_MAP_INVALIDATE_RANGE_BIT indicates that the previous contents of the specified range may be discarded.
It seems like the right thing to do would be to always specify that flag yet it is optional. Even if you do not specify
GL_MAP_INVALIDATE_RANGE_BIT or the other, similar flags I do not see how you could retrieve this data or what its value would be.
Are there performance reasons (or other reasons) why you would not want to invalidate the data that is in a buffer that you are writing over?