Skip to content

Commit

Permalink
Don't add event usage when m_CurEventID == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Mar 3, 2018
1 parent 169604e commit d65e433
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions renderdoc/driver/d3d11/d3d11_context_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5354,14 +5354,17 @@ bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion(
draw.copySource = srcOrigID;
draw.copyDestination = dstOrigID;

if(dstLiveID == srcLiveID)
if(m_CurEventID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Copy));
}
else
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopyDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopySrc));
if(dstLiveID == srcLiveID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Copy));
}
else
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopyDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopySrc));
}
}
}

Expand Down Expand Up @@ -5504,14 +5507,17 @@ bool WrappedID3D11DeviceContext::Serialise_CopyResource(SerialiserType &ser,
draw.copySource = srcOrigID;
draw.copyDestination = dstOrigID;

if(dstLiveID == srcLiveID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Copy));
}
else
if(m_CurEventID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopyDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopySrc));
if(dstLiveID == srcLiveID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Copy));
}
else
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopyDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::CopySrc));
}
}
}

Expand Down Expand Up @@ -6017,14 +6023,17 @@ bool WrappedID3D11DeviceContext::Serialise_ResolveSubresource(SerialiserType &se
draw.copySource = srcOrigID;
draw.copyDestination = dstOrigID;

if(dstLiveID == srcLiveID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Resolve));
}
else
if(m_CurEventID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::ResolveDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::ResolveSrc));
if(dstLiveID == srcLiveID)
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Resolve));
}
else
{
m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::ResolveDst));
m_ResourceUses[srcLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::ResolveSrc));
}
}
}

Expand Down

0 comments on commit d65e433

Please sign in to comment.