mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-04 13:50:59 +00:00
Fix buffer map diff comparison, and skip it for range maps
* For range maps, similar to glFlushMappedBufferRange, we assume the user selected the range deliberately and we upload it all. We only find a difference range for whole-buffer maps (of large enough buffers). This includes glMapBuffer(), by definition. * Also, the comparison point is between the map pointer, so we have to offset the shadow pointer to compare it against to get accurate results.
This commit is contained in:
@@ -1841,9 +1841,17 @@ bool WrappedOpenGL::Serialise_glUnmapNamedBufferEXT(GLuint buffer)
|
||||
size_t diffStart = 0;
|
||||
size_t diffEnd = (size_t)len;
|
||||
|
||||
if(m_State == WRITING_CAPFRAME && len > 512 && !record->Map.invalidate)
|
||||
if(m_State == WRITING_CAPFRAME &&
|
||||
// don't bother checking diff range for tiny buffers
|
||||
len > 512 &&
|
||||
// if the map has a sub-range specified, trust the user to have specified
|
||||
// a minimal range, similar to glFlushMappedBufferRange, so don't find diff
|
||||
// range.
|
||||
record->Map.offset == 0 && record->Map.length == record->Length &&
|
||||
// similarly for invalidate maps, we want to update the whole buffer
|
||||
!record->Map.invalidate)
|
||||
{
|
||||
bool found = FindDiffRange(record->Map.ptr, record->GetShadowPtr(1), (size_t)len, diffStart, diffEnd);
|
||||
bool found = FindDiffRange(record->Map.ptr, record->GetShadowPtr(1)+offs, (size_t)len, diffStart, diffEnd);
|
||||
if(found)
|
||||
{
|
||||
static size_t saved = 0;
|
||||
|
||||
Reference in New Issue
Block a user