When selecting the final swapchain present, use present target

* It was using the last bound render target, which could be empty if
  state was reset before presentation. Instead we use the copy target
  listed in the present drawcall as the actual swap buffer presented to.
This commit is contained in:
baldurk
2016-11-02 17:51:00 +01:00
parent 5a5c576a33
commit e040249398
4 changed files with 9 additions and 2 deletions
+2
View File
@@ -797,6 +797,8 @@ void WrappedID3D11DeviceContext::ProcessChunk(uint64_t offset, D3D11ChunkType ch
draw.name = "Present()";
draw.flags |= eDraw_Present;
draw.copyDestination = m_pDevice->GetBackbufferResourceID();
AddDrawcall(draw, true);
}
}
+2
View File
@@ -2500,6 +2500,8 @@ bool WrappedID3D11Device::Serialise_WrapSwapchainBuffer(WrappedIDXGISwapChain4 *
SERIALISE_ELEMENT(uint32_t, BuffNum, buffer);
SERIALISE_ELEMENT(ResourceId, pTexture, GetIDForResource(pTex));
m_BBID = pTexture;
if(m_State >= WRITING)
{
D3D11_TEXTURE2D_DESC desc;
+3
View File
@@ -340,6 +340,8 @@ private:
D3D11InitParams m_InitParams;
ResourceId m_BBID;
ID3D11Device *m_pDevice;
ID3D11Device1 *m_pDevice1;
ID3D11Device2 *m_pDevice2;
@@ -525,6 +527,7 @@ public:
void ReleaseSwapchainResources(WrappedIDXGISwapChain4 *swap, UINT QueueCount,
IUnknown *const *ppPresentQueue, IUnknown **unwrappedQueues);
ResourceId GetBackbufferResourceID() { return m_BBID; }
void InternalRef() { InterlockedIncrement(&m_InternalRefcount); }
void InternalRelease() { InterlockedDecrement(&m_InternalRefcount); }
void SoftRef() { m_SoftRefCounter.AddRef(); }
+2 -2
View File
@@ -98,7 +98,7 @@ namespace renderdocui.Windows
public static void GetDrawContext(Core core, out bool copy, out bool compute)
{
var curDraw = core.CurDrawcall;
copy = curDraw != null && (curDraw.flags & (DrawcallFlags.Copy | DrawcallFlags.Resolve)) != 0;
copy = curDraw != null && (curDraw.flags & (DrawcallFlags.Copy | DrawcallFlags.Resolve | DrawcallFlags.Present)) != 0;
compute = curDraw != null && (curDraw.flags & DrawcallFlags.Dispatch) != 0 &&
core.CurPipelineState.GetShader(ShaderStageType.Compute) != ResourceId.Null;
}
@@ -1420,7 +1420,7 @@ namespace renderdocui.Windows
int roIndex = 0;
var curDraw = m_Core.GetDrawcall(eventID);
bool copy = curDraw != null && (curDraw.flags & (DrawcallFlags.Copy|DrawcallFlags.Resolve)) != 0;
bool copy = curDraw != null && (curDraw.flags & (DrawcallFlags.Copy|DrawcallFlags.Resolve|DrawcallFlags.Present)) != 0;
bool compute = curDraw != null && (curDraw.flags & (DrawcallFlags.Dispatch)) != 0;
for(int rt=0; rt < RTs.Length; rt++)