diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 0c0c9e4b8..db3604dbe 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -66,6 +66,8 @@ CaptureContext::CaptureContext(PersistantConfig &cfg) : m_Config(cfg) { + RENDERDOC_PROFILEFUNCTION(); + m_CaptureLoaded = false; m_LoadInProgress = false; @@ -699,6 +701,8 @@ void CaptureContext::CleanMenu(QAction *action) void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions &opts, const rdcstr &origFilename, bool temporary, bool local) { + RENDERDOC_PROFILEFUNCTION(); + CloseCapture(); PointerTypeRegistry::Init(); @@ -1458,6 +1462,8 @@ void CaptureContext::ExportCapture(const CaptureFileFormat &fmt, const rdcstr &e void CaptureContext::SetEventID(const rdcarray &exclude, uint32_t selectedEventID, uint32_t eventId, bool force) { + RENDERDOC_PROFILEFUNCTION(); + if(!IsCaptureLoaded()) return; diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index d8f0af76d..34b0195c0 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -131,6 +131,8 @@ void PipelineStateViewer::OnCaptureClosed() void PipelineStateViewer::OnEventChanged(uint32_t eventId) { + RENDERDOC_PROFILEFUNCTION(); + if(m_Ctx.APIProps().pipelineType == GraphicsAPI::D3D11) setToD3D11(); else if(m_Ctx.APIProps().pipelineType == GraphicsAPI::D3D12) diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index 7dd0bec89..e8ff0353e 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -1489,6 +1489,7 @@ void WrappedID3D11Device::ReplayLog(uint32_t startEventID, uint32_t endEventID, if(!partial) { + RENDERDOC_PROFILEREGION("ApplyInitialContents"); D3D11MarkerRegion apply("!!!!RenderDoc Internal: ApplyInitialContents"); GetResourceManager()->ApplyInitialContents(); } diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index dd353637c..34215095e 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -1271,6 +1271,8 @@ ID3D12Resource *WrappedID3D12Device::GetUploadBuffer(uint64_t chunkOffset, uint6 void WrappedID3D12Device::ApplyInitialContents() { + RENDERDOC_PROFILEFUNCTION(); + initStateCurBatch = 0; initStateCurList = NULL; diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index dc2aeee15..7a9441211 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -5636,6 +5636,7 @@ void WrappedOpenGL::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay if(!partial) { + RENDERDOC_PROFILEREGION("ApplyInitialContents"); GLMarkerRegion apply("!!!!RenderDoc Internal: ApplyInitialContents"); GetResourceManager()->ApplyInitialContents(); diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index bbcbb59fe..532ce9df8 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -254,6 +254,7 @@ void WrappedVulkan::AddFreeCommandBuffer(VkCommandBuffer cmd) void WrappedVulkan::SubmitCmds(VkSemaphore *unwrappedWaitSemaphores, VkPipelineStageFlags *waitStageMask, uint32_t waitSemaphoreCount) { + RENDERDOC_PROFILEFUNCTION(); // nothing to do if(m_InternalCmds.pendingcmds.empty()) return; @@ -333,6 +334,7 @@ void WrappedVulkan::SubmitSemaphores() void WrappedVulkan::FlushQ() { + RENDERDOC_PROFILEFUNCTION(); // VKTODOLOW could do away with the need for this function by keeping // commands until N presents later, or something, or checking on fences. // If we do so, then check each use for FlushQ to see if it needs a @@ -2695,6 +2697,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta void WrappedVulkan::ApplyInitialContents() { + RENDERDOC_PROFILEFUNCTION(); VkMarkerRegion region("ApplyInitialContents"); // check that we have all external queues necessary diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index 1aa1cce21..558055d9a 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -91,6 +91,7 @@ ReplayController::~ReplayController() void ReplayController::SetFrameEvent(uint32_t eventId, bool force) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); if(eventId != m_EventID || force) { @@ -165,6 +166,8 @@ rdcstr ReplayController::DisassembleShader(ResourceId pipeline, const ShaderRefl { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + if(refl == NULL) return "; Error: No shader specified"; @@ -419,6 +422,8 @@ rdcarray ReplayController::FetchCounters(const rdcarrayFetchCounters(counters); } @@ -533,6 +538,7 @@ bytebuf ReplayController::GetBufferData(ResourceId buff, uint64_t offset, uint64 bytebuf ReplayController::GetTextureData(ResourceId tex, const Subresource &sub) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); bytebuf ret; @@ -552,6 +558,7 @@ bytebuf ReplayController::GetTextureData(ResourceId tex, const Subresource &sub) bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); TextureSave sd = saveData; // mutable copy ResourceId liveid = m_pDevice->GetLiveID(sd.resourceId); @@ -1414,6 +1421,8 @@ rdcarray ReplayController::PixelHistory(ResourceId target, ui { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + rdcarray ret; Subresource subresource = sub; @@ -1541,6 +1550,7 @@ PixelValue ReplayController::PickPixel(ResourceId tex, uint32_t x, uint32_t y, const Subresource &sub, CompType typeCast) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); PixelValue ret; @@ -1587,6 +1597,8 @@ ShaderDebugTrace *ReplayController::DebugVertex(uint32_t vertid, uint32_t instid { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + ShaderDebugTrace *ret = m_pDevice->DebugVertex(m_EventID, vertid, instid, idx, view); SetFrameEvent(m_EventID, true); @@ -1599,6 +1611,8 @@ ShaderDebugTrace *ReplayController::DebugPixel(uint32_t x, uint32_t y, uint32_t { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + ShaderDebugTrace *ret = m_pDevice->DebugPixel(m_EventID, x, y, sample, primitive); SetFrameEvent(m_EventID, true); @@ -1610,6 +1624,8 @@ ShaderDebugTrace *ReplayController::DebugThread(const uint32_t groupid[3], const { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + ShaderDebugTrace *ret = m_pDevice->DebugThread(m_EventID, groupid, threadid); SetFrameEvent(m_EventID, true); @@ -1621,6 +1637,8 @@ rdcarray ReplayController::ContinueDebug(ShaderDebugger *debug { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + rdcarray ret = m_pDevice->ContinueDebug(debugger); return ret; @@ -1643,6 +1661,8 @@ rdcarray ReplayController::GetCBufferVariableContents( { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + bytebuf data; if(buffer != ResourceId()) { @@ -1857,6 +1877,8 @@ rdcpair ReplayController::BuildTargetShader( { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + if(source.empty()) return rdcpair(ResourceId(), "0-byte shader is not valid"); @@ -1975,6 +1997,8 @@ ReplayStatus ReplayController::CreateDevice(RDCFile *rdc, const ReplayOptions &o { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + IReplayDriver *driver = NULL; ReplayStatus status = RenderDoc::Inst().CreateReplayDriver(rdc, opts, &driver); @@ -2006,6 +2030,8 @@ ReplayStatus ReplayController::PostCreateInit(IReplayDriver *device, RDCFile *rd { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + m_pDevice = device; m_APIProps = m_pDevice->GetAPIProperties(); @@ -2054,6 +2080,8 @@ void ReplayController::FetchPipelineState(uint32_t eventId) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + m_pDevice->SavePipelineState(eventId); m_D3D11PipelineState = m_pDevice->GetD3D11PipelineState(); diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index 3b75515ce..b964d2fd1 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -389,6 +389,8 @@ rdcpair ReplayOutput::PickVertex(uint32_t x, uint32_t y) { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); const rdcpair errorReturn = {~0U, ~0U}; @@ -566,6 +568,8 @@ void ReplayOutput::Display() { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + if(m_pDevice->CheckResizeOutputWindow(m_MainOutput.outputID)) { m_pDevice->GetOutputWindowDimensions(m_MainOutput.outputID, m_Width, m_Height); @@ -680,6 +684,8 @@ void ReplayOutput::DisplayTex() { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); if(m_MainOutput.outputID == 0) @@ -767,6 +773,8 @@ void ReplayOutput::DisplayMesh() { CHECK_REPLAY_THREAD(); + RENDERDOC_PROFILEFUNCTION(); + DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); if(draw == NULL || m_MainOutput.outputID == 0 || m_Width <= 0 || m_Height <= 0 ||