Remove forceExecute parameter from GL/Vulkan drivers

* This is only needed on D3D11 for historical architectural reasons as
  clears/copies/etc can be stored in the pre-capture chunks.
This commit is contained in:
baldurk
2016-06-20 12:13:46 +02:00
parent 1a15e230ad
commit e173cc2268
4 changed files with 14 additions and 34 deletions
+10 -22
View File
@@ -3704,7 +3704,7 @@ void WrappedOpenGL::ContextReplayLog(LogState readType, uint32_t startEventID, u
GLChunkType chunktype = (GLChunkType)m_pSerialiser->PushContext(NULL, NULL, 1, false);
ContextProcessChunk(offset, chunktype, false);
ContextProcessChunk(offset, chunktype);
RenderDoc::Inst().SetProgress(FrameEventsRead,
float(offset - startOffset) / float(m_pSerialiser->GetSize()));
@@ -3743,50 +3743,38 @@ void WrappedOpenGL::ContextReplayLog(LogState readType, uint32_t startEventID, u
m_DoStateVerify = false;
}
void WrappedOpenGL::ContextProcessChunk(uint64_t offset, GLChunkType chunk, bool forceExecute)
void WrappedOpenGL::ContextProcessChunk(uint64_t offset, GLChunkType chunk)
{
m_CurChunkOffset = offset;
WrappedOpenGL *context = this;
LogState state = context->m_State;
if(forceExecute)
context->m_State = EXECUTING;
else
context->m_State = m_State;
m_AddedDrawcall = false;
ProcessChunk(offset, chunk);
m_pSerialiser->PopContext(chunk);
if(context->m_State == READING && chunk == SET_MARKER)
if(m_State == READING && chunk == SET_MARKER)
{
// no push/pop necessary
}
else if(context->m_State == READING && chunk == BEGIN_EVENT)
else if(m_State == READING && chunk == BEGIN_EVENT)
{
// push down the drawcallstack to the latest drawcall
context->m_DrawcallStack.push_back(&context->m_DrawcallStack.back()->children.back());
m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back());
}
else if(context->m_State == READING && chunk == END_EVENT)
else if(m_State == READING && chunk == END_EVENT)
{
// refuse to pop off further than the root drawcall (mismatched begin/end events e.g.)
if(context->m_DrawcallStack.size() > 1)
context->m_DrawcallStack.pop_back();
if(m_DrawcallStack.size() > 1)
m_DrawcallStack.pop_back();
}
else if(context->m_State == READING)
else if(m_State == READING)
{
if(!m_AddedDrawcall)
context->AddEvent(chunk, m_pSerialiser->GetDebugStr());
AddEvent(chunk, m_pSerialiser->GetDebugStr());
}
m_AddedDrawcall = false;
if(forceExecute)
context->m_State = state;
}
void WrappedOpenGL::AddUsage(const FetchDrawcall &d)
+1 -1
View File
@@ -330,7 +330,7 @@ private:
uint32_t GetLogVersion() { return m_InitParams.SerialiseVersion; }
void ProcessChunk(uint64_t offset, GLChunkType context);
void ContextReplayLog(LogState readType, uint32_t startEventID, uint32_t endEventID, bool partial);
void ContextProcessChunk(uint64_t offset, GLChunkType chunk, bool forceExecute);
void ContextProcessChunk(uint64_t offset, GLChunkType chunk);
void AddUsage(const FetchDrawcall &d);
void AddDrawcall(const FetchDrawcall &d, bool hasEvents);
void AddEvent(GLChunkType type, string description, ResourceId ctx = ResourceId());
+2 -10
View File
@@ -1595,7 +1595,7 @@ void WrappedVulkan::ContextReplayLog(LogState readType, uint32_t startEventID, u
m_LastCmdBufferID = ResourceId();
ContextProcessChunk(offset, context, false);
ContextProcessChunk(offset, context);
RenderDoc::Inst().SetProgress(FileInitialRead, float(offset) / float(m_pSerialiser->GetSize()));
@@ -1724,15 +1724,10 @@ void WrappedVulkan::ApplyInitialContents()
#endif
}
void WrappedVulkan::ContextProcessChunk(uint64_t offset, VulkanChunkType chunk, bool forceExecute)
void WrappedVulkan::ContextProcessChunk(uint64_t offset, VulkanChunkType chunk)
{
m_CurChunkOffset = offset;
LogState state = m_State;
if(forceExecute)
m_State = EXECUTING;
m_AddedDrawcall = false;
ProcessChunk(offset, chunk);
@@ -1755,9 +1750,6 @@ void WrappedVulkan::ContextProcessChunk(uint64_t offset, VulkanChunkType chunk,
}
m_AddedDrawcall = false;
if(forceExecute)
m_State = state;
}
void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
+1 -1
View File
@@ -546,7 +546,7 @@ private:
void ProcessChunk(uint64_t offset, VulkanChunkType context);
void ContextReplayLog(LogState readType, uint32_t startEventID, uint32_t endEventID, bool partial);
void ContextProcessChunk(uint64_t offset, VulkanChunkType chunk, bool forceExecute);
void ContextProcessChunk(uint64_t offset, VulkanChunkType chunk);
void AddDrawcall(const FetchDrawcall &d, bool hasEvents);
void AddEvent(VulkanChunkType type, string description);