diff --git a/renderdoc/driver/d3d11/d3d11_device_wrap.cpp b/renderdoc/driver/d3d11/d3d11_device_wrap.cpp index 3c088d86c..e60ef2768 100644 --- a/renderdoc/driver/d3d11/d3d11_device_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_device_wrap.cpp @@ -398,6 +398,12 @@ HRESULT WrappedID3D11Device::CreateTexture1D( record->AddChunk(chunk); record->SetDataPtr(chunk->GetData()); } + else + { + WrappedID3D11Texture1D *w = (WrappedID3D11Texture1D *)wrapped; + + GetResourceManager()->AddLiveResource(w->GetResourceID(), wrapped); + } *ppTexture1D = wrapped; } @@ -606,6 +612,12 @@ HRESULT WrappedID3D11Device::CreateTexture3D( record->AddChunk(chunk); record->SetDataPtr(chunk->GetData()); } + else + { + WrappedID3D11Texture3D *w = (WrappedID3D11Texture3D *)wrapped; + + GetResourceManager()->AddLiveResource(w->GetResourceID(), wrapped); + } *ppTexture3D = wrapped; } diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 1ed51e19d..8544e0081 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -1369,6 +1369,8 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) { ResourceId ret; + ID3D11Resource *resource = NULL; + if(templateTex.dimension == 1) { ID3D11Texture1D *throwaway = NULL; @@ -1393,6 +1395,8 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) RDCERR("Failed to create 1D proxy texture"); return ResourceId(); } + + resource = throwaway; if(templateTex.creationFlags & eTextureCreate_DSV) desc.Format = GetTypelessFormat(desc.Format); @@ -1426,6 +1430,9 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) desc.Format = GetTypelessFormat(desc.Format); } + if(templateTex.cubemap) + desc.MiscFlags |= D3D11_RESOURCE_MISC_TEXTURECUBE; + HRESULT hr = m_pDevice->CreateTexture2D(&desc, NULL, &throwaway); if(FAILED(hr)) { @@ -1433,6 +1440,8 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) return ResourceId(); } + resource = throwaway; + ret = ((WrappedID3D11Texture2D *)throwaway)->GetResourceID(); if(templateTex.creationFlags & eTextureCreate_DSV) WrappedID3D11Texture2D::m_TextureList[ret].m_Type = TEXDISPLAY_DEPTH_TARGET; @@ -1463,6 +1472,8 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) return ResourceId(); } + resource = throwaway; + ret = ((WrappedID3D11Texture3D *)throwaway)->GetResourceID(); } else @@ -1470,6 +1481,12 @@ ResourceId D3D11Replay::CreateProxyTexture(FetchTexture templateTex) RDCERR("Invalid texture dimension: %d", templateTex.dimension); } + if(resource != NULL && templateTex.customName) + { + string name = narrow(wstring(templateTex.name.elems)); + SetDebugName(resource, name.c_str()); + } + return ret; }