mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-07 14:35:48 +00:00
Only try to read annotations when capturing
* This iterator will be invalid on replay
This commit is contained in:
4 files changed
+34
-14
No files matched your search
@@ -473,18 +473,23 @@ bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser
|
||||
for(uint32_t i = 0; i < numAnnotations; i++)
|
||||
{
|
||||
SERIALISE_ELEMENT_LOCAL(id, it->first);
|
||||
SDObject *annotation = it->second;
|
||||
SDObject *annotation = NULL;
|
||||
if(ser.IsReading())
|
||||
{
|
||||
annotation = new SDObject(""_lit, ""_lit); // will be overwritten below
|
||||
}
|
||||
else
|
||||
{
|
||||
annotation = it->second;
|
||||
it++;
|
||||
}
|
||||
ser.Serialise("annotation"_lit, *annotation);
|
||||
|
||||
if(ser.IsReading() && IsLoading(m_State))
|
||||
{
|
||||
m_Annotations[id] = annotation;
|
||||
m_pDevice->GetReplay()->GetResourceDesc(id).annotations = annotation;
|
||||
m_Replay->GetResourceDesc(id).annotations = annotation;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
if(numAnnotations > 0)
|
||||
|
||||
@@ -2761,9 +2761,16 @@ bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
for(uint32_t i = 0; i < numAnnotations; i++)
|
||||
{
|
||||
SERIALISE_ELEMENT_LOCAL(id, it->first);
|
||||
SDObject *annotation = it->second;
|
||||
SDObject *annotation = NULL;
|
||||
if(ser.IsReading())
|
||||
{
|
||||
annotation = new SDObject(""_lit, ""_lit); // will be overwritten below
|
||||
}
|
||||
else
|
||||
{
|
||||
annotation = it->second;
|
||||
it++;
|
||||
}
|
||||
ser.Serialise("annotation"_lit, *annotation);
|
||||
|
||||
if(ser.IsReading() && IsLoading(m_State))
|
||||
@@ -2771,8 +2778,6 @@ bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
m_Annotations[id] = annotation;
|
||||
m_Replay->GetResourceDesc(id).annotations = annotation;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
if(numAnnotations > 0)
|
||||
|
||||
@@ -3142,18 +3142,23 @@ bool WrappedOpenGL::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
for(uint32_t i = 0; i < numAnnotations; i++)
|
||||
{
|
||||
SERIALISE_ELEMENT_LOCAL(id, it->first);
|
||||
SDObject *annotation = it->second;
|
||||
SDObject *annotation = NULL;
|
||||
if(ser.IsReading())
|
||||
{
|
||||
annotation = new SDObject(""_lit, ""_lit); // will be overwritten below
|
||||
}
|
||||
else
|
||||
{
|
||||
annotation = it->second;
|
||||
it++;
|
||||
}
|
||||
ser.Serialise("annotation"_lit, *annotation);
|
||||
|
||||
if(ser.IsReading() && IsLoading(m_State))
|
||||
{
|
||||
m_Annotations[id] = annotation;
|
||||
GetReplay()->GetResourceDesc(id).annotations = annotation;
|
||||
m_Replay->GetResourceDesc(id).annotations = annotation;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
if(numAnnotations > 0)
|
||||
|
||||
@@ -2643,9 +2643,16 @@ bool WrappedVulkan::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
for(uint32_t i = 0; i < numAnnotations; i++)
|
||||
{
|
||||
SERIALISE_ELEMENT_LOCAL(id, it->first);
|
||||
SDObject *annotation = it->second;
|
||||
SDObject *annotation = NULL;
|
||||
if(ser.IsReading())
|
||||
{
|
||||
annotation = new SDObject(""_lit, ""_lit); // will be overwritten below
|
||||
}
|
||||
else
|
||||
{
|
||||
annotation = it->second;
|
||||
it++;
|
||||
}
|
||||
ser.Serialise("annotation"_lit, *annotation);
|
||||
|
||||
if(ser.IsReading() && IsLoading(m_State))
|
||||
@@ -2653,8 +2660,6 @@ bool WrappedVulkan::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
m_Annotations[id] = annotation;
|
||||
m_Replay->GetResourceDesc(id).annotations = annotation;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
if(numAnnotations > 0)
|
||||
|
||||
Reference in new issue
Block a user