From 48248c460c45f676813db5322e776a328a02f40a Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 5 Oct 2015 14:39:34 +0200 Subject: [PATCH] Update qrenderdoc to handle vulkan pipeline state --- qrenderdoc/Code/Core.cpp | 2 ++ qrenderdoc/Code/Core.h | 1 + qrenderdoc/Windows/TextureViewer.cpp | 26 +++++++++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Code/Core.cpp b/qrenderdoc/Code/Core.cpp index 661223a9e..998b2d50b 100644 --- a/qrenderdoc/Code/Core.cpp +++ b/qrenderdoc/Code/Core.cpp @@ -106,6 +106,7 @@ void Core::LoadLogfile(int proxyRenderer, QString replayHost, QString logFile, b r->GetD3D11PipelineState(&CurD3D11PipelineState); r->GetGLPipelineState(&CurGLPipelineState); + r->GetVulkanPipelineState(&CurVulkanPipelineState); //CurPipelineState.SetStates(m_APIProps, CurD3D11PipelineState, CurGLPipelineState); UnreadMessageCount = 0; @@ -140,6 +141,7 @@ void Core::SetEventID(ILogViewerForm *exclude, uint32_t frameID, uint32_t eventI r->SetFrameEvent(frameID, eventID); r->GetD3D11PipelineState(&CurD3D11PipelineState); r->GetGLPipelineState(&CurGLPipelineState); + r->GetVulkanPipelineState(&CurVulkanPipelineState); //CurPipelineState.SetStates(m_APIProps, CurD3D11PipelineState, CurGLPipelineState); }); diff --git a/qrenderdoc/Code/Core.h b/qrenderdoc/Code/Core.h index 0b60097be..7188ec2fe 100644 --- a/qrenderdoc/Code/Core.h +++ b/qrenderdoc/Code/Core.h @@ -111,6 +111,7 @@ class Core D3D11PipelineState CurD3D11PipelineState; GLPipelineState CurGLPipelineState; + VulkanPipelineState CurVulkanPipelineState; //CommonPipelineState CurPipelineState; private: diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index d4ed7f4de..11ffd2ac0 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -127,9 +127,19 @@ void TextureViewer::on_render_clicked(QMouseEvent *e) ResourceId id; if(m_Core->APIProps().pipelineType == ePipelineState_D3D11) - id = m_Core->CurD3D11PipelineState.m_OM.RenderTargets[0].Resource; + { + id = m_Core->CurD3D11PipelineState.m_OM.RenderTargets[0].Resource; + } + else if(m_Core->APIProps().pipelineType == ePipelineState_OpenGL) + { + id = m_Core->CurGLPipelineState.m_FB.m_DrawFBO.Color[0].Obj; + } else - id = m_Core->CurGLPipelineState.m_FB.m_DrawFBO.Color[0].Obj; + { + const VulkanPipelineState &pipe = m_Core->CurVulkanPipelineState; + if(pipe.Pass.renderpass.colorAttachments.count > 0) + id = pipe.Pass.framebuffer.attachments[pipe.Pass.renderpass.colorAttachments[0]].img; + } PixelValue val; ReplayOutput_PickPixel(m_Output, id, false, x, y, 0, 0, 0, &val); @@ -183,9 +193,19 @@ void TextureViewer::OnEventSelected(uint32_t frameID, uint32_t eventID) m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) { TextureDisplay d; if(m_Core->APIProps().pipelineType == ePipelineState_D3D11) + { d.texid = m_Core->CurD3D11PipelineState.m_OM.RenderTargets[0].Resource; - else + } + else if(m_Core->APIProps().pipelineType == ePipelineState_OpenGL) + { d.texid = m_Core->CurGLPipelineState.m_FB.m_DrawFBO.Color[0].Obj; + } + else + { + const VulkanPipelineState &pipe = m_Core->CurVulkanPipelineState; + if(pipe.Pass.renderpass.colorAttachments.count > 0) + d.texid = pipe.Pass.framebuffer.attachments[pipe.Pass.renderpass.colorAttachments[0]].img; + } d.mip = 0; d.sampleIdx = ~0U; d.overlay = eTexOverlay_None;