Set drawcall outputs array and depthOutput to original IDs. Refs #632

* Also ensures that the underlying image ID is used, not any view that
  uses the ID.
This commit is contained in:
baldurk
2017-06-02 14:54:18 +01:00
parent 745a4e4c76
commit d426020321
4 changed files with 35 additions and 10 deletions
+4 -4
View File
@@ -970,16 +970,16 @@ void WrappedID3D11DeviceContext::AddDrawcall(const DrawcallDescription &d, bool
{
draw.outputs[i] = ResourceId();
if(m_CurrentPipelineState->OM.RenderTargets[i])
draw.outputs[i] =
draw.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID(
((WrappedID3D11RenderTargetView1 *)m_CurrentPipelineState->OM.RenderTargets[i])
->GetResourceResID();
->GetResourceResID());
}
{
draw.depthOut = ResourceId();
if(m_CurrentPipelineState->OM.DepthView)
draw.depthOut =
((WrappedID3D11DepthStencilView *)m_CurrentPipelineState->OM.DepthView)->GetResourceResID();
draw.depthOut = m_pDevice->GetResourceManager()->GetOriginalID(
((WrappedID3D11DepthStencilView *)m_CurrentPipelineState->OM.DepthView)->GetResourceResID());
}
// markers don't increment drawcall ID
+3 -2
View File
@@ -1194,12 +1194,13 @@ void D3D12CommandData::AddDrawcall(const DrawcallDescription &d, bool hasEvents,
for(size_t i = 0; i < ARRAY_COUNT(draw.outputs); i++)
{
if(i < rts.size())
draw.outputs[i] = rts[i];
draw.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID(rts[i]);
else
draw.outputs[i] = ResourceId();
}
draw.depthOut = m_BakedCmdListInfo[m_LastCmdListID].state.GetDSVID();
draw.depthOut = m_pDevice->GetResourceManager()->GetOriginalID(
m_BakedCmdListInfo[m_LastCmdListID].state.GetDSVID());
}
if(m_LastCmdListID != ResourceId())
+24 -2
View File
@@ -4303,6 +4303,7 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d, bool hasEvents)
draw.eventID = m_CurEventID;
draw.drawcallID = m_CurDrawcallID;
GLenum type;
GLuint curCol[8] = {0};
GLuint curDepth = 0;
@@ -4314,16 +4315,37 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d, bool hasEvents)
for(GLint i = 0; i < RDCMIN(numCols, 8); i++)
{
type = eGL_TEXTURE;
m_Real.glGetFramebufferAttachmentParameteriv(
eGL_DRAW_FRAMEBUFFER, GLenum(eGL_COLOR_ATTACHMENT0 + i),
eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, (GLint *)&curCol[i]);
draw.outputs[i] = GetResourceManager()->GetID(TextureRes(GetCtx(), curCol[i]));
m_Real.glGetFramebufferAttachmentParameteriv(
eGL_DRAW_FRAMEBUFFER, GLenum(eGL_COLOR_ATTACHMENT0 + i),
eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, (GLint *)&type);
if(type == eGL_TEXTURE)
draw.outputs[i] = GetResourceManager()->GetOriginalID(
GetResourceManager()->GetID(TextureRes(GetCtx(), curCol[i])));
else
draw.outputs[i] = GetResourceManager()->GetOriginalID(
GetResourceManager()->GetID(RenderbufferRes(GetCtx(), curCol[i])));
}
type = eGL_TEXTURE;
m_Real.glGetFramebufferAttachmentParameteriv(eGL_DRAW_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT,
eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
(GLint *)&curDepth);
draw.depthOut = GetResourceManager()->GetID(TextureRes(GetCtx(), curDepth));
m_Real.glGetFramebufferAttachmentParameteriv(eGL_DRAW_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT,
eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
(GLint *)&type);
if(type == eGL_TEXTURE)
draw.depthOut = GetResourceManager()->GetOriginalID(
GetResourceManager()->GetID(TextureRes(GetCtx(), curDepth)));
else
draw.depthOut = GetResourceManager()->GetOriginalID(
GetResourceManager()->GetID(RenderbufferRes(GetCtx(), curDepth)));
}
// markers don't increment drawcall ID
+4 -2
View File
@@ -2784,13 +2784,15 @@ void WrappedVulkan::AddDrawcall(const DrawcallDescription &d, bool hasEvents)
continue;
RDCASSERT(colAtt[i] < atts.size());
draw.outputs[i] = atts[colAtt[i]].view;
draw.outputs[i] = GetResourceManager()->GetOriginalID(
m_CreationInfo.m_ImageView[atts[colAtt[i]].view].image);
}
if(dsAtt != -1)
{
RDCASSERT(dsAtt < (int32_t)atts.size());
draw.depthOut = atts[dsAtt].view;
draw.depthOut =
GetResourceManager()->GetOriginalID(m_CreationInfo.m_ImageView[atts[dsAtt].view].image);
}
}
}