mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-27 17:06:32 +00:00
Fix D3D11 debug messages being off by one event
This commit is contained in:
@@ -1162,6 +1162,19 @@ void WrappedID3D11DeviceContext::AddEvent()
|
||||
|
||||
apievent.chunkIndex = uint32_t(m_StructuredFile->chunks.size() - 1);
|
||||
|
||||
// if we're using replay-time debug messages, fetch them now since we can do better to correlate
|
||||
// to events on replay
|
||||
if(m_pDevice->GetReplayOptions().apiValidation)
|
||||
{
|
||||
rdcarray<DebugMessage> messages = m_pDevice->GetDebugMessages();
|
||||
|
||||
for(size_t i = 0; i < messages.size(); i++)
|
||||
{
|
||||
messages[i].eventId = apievent.eventId;
|
||||
m_pDevice->AddDebugMessage(messages[i]);
|
||||
}
|
||||
}
|
||||
|
||||
m_CurEvents.push_back(apievent);
|
||||
|
||||
if(IsLoading(m_State))
|
||||
|
||||
@@ -3776,15 +3776,10 @@ void WrappedID3D11DeviceContext::Serialise_DebugMessages(SerialiserType &ser)
|
||||
|
||||
SERIALISE_ELEMENT(DebugMessages);
|
||||
|
||||
// if we're using replay-time API validation, fetch messages at replay time and ignore any
|
||||
// serialised ones
|
||||
// if we're using replay-time API validation, we fetch messages at replay time in AddEvent and
|
||||
// ignore any serialised ones
|
||||
if(ser.IsReading() && IsLoading(m_State) && m_pDevice->GetReplayOptions().apiValidation)
|
||||
{
|
||||
if(GetType() == D3D11_DEVICE_CONTEXT_IMMEDIATE)
|
||||
DebugMessages = m_pDevice->GetDebugMessages();
|
||||
else
|
||||
DebugMessages.clear();
|
||||
}
|
||||
DebugMessages.clear();
|
||||
|
||||
// hide empty sets of messages.
|
||||
if(ser.IsReading() && DebugMessages.empty())
|
||||
|
||||
Reference in New Issue
Block a user