From e173cc2268b7f5515c15430505667a04024726aa Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 20 Jun 2016 12:13:46 +0200 Subject: [PATCH] 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. --- renderdoc/driver/gl/gl_driver.cpp | 32 +++++++++-------------------- renderdoc/driver/gl/gl_driver.h | 2 +- renderdoc/driver/vulkan/vk_core.cpp | 12 ++--------- renderdoc/driver/vulkan/vk_core.h | 2 +- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 29a044be5..fae51760d 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -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) diff --git a/renderdoc/driver/gl/gl_driver.h b/renderdoc/driver/gl/gl_driver.h index 72b19aaf8..af4dfc50e 100644 --- a/renderdoc/driver/gl/gl_driver.h +++ b/renderdoc/driver/gl/gl_driver.h @@ -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()); diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 68ecd0ab2..2487ace27 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -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) diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index 45f227914..7234db4ba 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -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);