mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 01:00:51 +00:00
Fail out of chunk serialisation if API calls fail
* For a few primary cases, we check to see if the API call failed (or is looking like it will fail, in the case of vulkan) and bail out. This will cause the capture to fail to load.
This commit is contained in:
@@ -90,6 +90,7 @@ bool WrappedID3D11Device::Serialise_CreateBlendState1(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,6 +189,7 @@ bool WrappedID3D11Device::Serialise_CreateRasterizerState1(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -86,6 +86,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture2D1(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -221,6 +222,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture3D1(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -364,6 +366,7 @@ bool WrappedID3D11Device::Serialise_CreateShaderResourceView1(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -507,6 +510,7 @@ bool WrappedID3D11Device::Serialise_CreateRenderTargetView1(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -619,6 +623,7 @@ bool WrappedID3D11Device::Serialise_CreateUnorderedAccessView1(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -723,6 +728,7 @@ bool WrappedID3D11Device::Serialise_CreateRasterizerState2(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -822,6 +828,7 @@ bool WrappedID3D11Device::Serialise_CreateQuery1(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -113,6 +113,7 @@ bool WrappedID3D11Device::Serialise_CreateBuffer(SerialiserType &ser, const D3D1
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -379,6 +380,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture1D(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -506,6 +508,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture2D(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -633,6 +636,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture3D(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,6 +767,7 @@ bool WrappedID3D11Device::Serialise_CreateShaderResourceView(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -863,6 +868,7 @@ bool WrappedID3D11Device::Serialise_CreateUnorderedAccessView(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -993,6 +999,7 @@ bool WrappedID3D11Device::Serialise_CreateRenderTargetView(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1093,6 +1100,7 @@ bool WrappedID3D11Device::Serialise_CreateDepthStencilView(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1193,6 +1201,7 @@ bool WrappedID3D11Device::Serialise_CreateInputLayout(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1283,6 +1292,7 @@ bool WrappedID3D11Device::Serialise_CreateVertexShader(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1372,6 +1382,7 @@ bool WrappedID3D11Device::Serialise_CreateGeometryShader(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1466,6 +1477,7 @@ bool WrappedID3D11Device::Serialise_CreateGeometryShaderWithStreamOutput(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1561,6 +1573,7 @@ bool WrappedID3D11Device::Serialise_CreatePixelShader(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1648,6 +1661,7 @@ bool WrappedID3D11Device::Serialise_CreateHullShader(SerialiserType &ser, const
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1736,6 +1750,7 @@ bool WrappedID3D11Device::Serialise_CreateDomainShader(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1825,6 +1840,7 @@ bool WrappedID3D11Device::Serialise_CreateComputeShader(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1923,6 +1939,7 @@ bool WrappedID3D11Device::Serialise_CreateClassInstance(SerialiserType &ser, LPC
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1990,6 +2007,7 @@ bool WrappedID3D11Device::Serialise_GetClassInstance(SerialiserType &ser, LPCSTR
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2050,6 +2068,7 @@ bool WrappedID3D11Device::Serialise_CreateClassLinkage(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2113,6 +2132,7 @@ bool WrappedID3D11Device::Serialise_CreateBlendState(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2205,6 +2225,7 @@ bool WrappedID3D11Device::Serialise_CreateDepthStencilState(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2297,6 +2318,7 @@ bool WrappedID3D11Device::Serialise_CreateRasterizerState(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2389,6 +2411,7 @@ bool WrappedID3D11Device::Serialise_CreateSamplerState(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2481,6 +2504,7 @@ bool WrappedID3D11Device::Serialise_CreateQuery(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2544,6 +2568,7 @@ bool WrappedID3D11Device::Serialise_CreatePredicate(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2608,6 +2633,7 @@ bool WrappedID3D11Device::Serialise_CreateCounter(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2672,6 +2698,7 @@ bool WrappedID3D11Device::Serialise_CreateDeferredContext(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2793,6 +2820,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(SerialiserType &ser, HAND
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2869,6 +2897,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(SerialiserType &ser, HAND
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2914,6 +2943,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(SerialiserType &ser, HAND
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2959,6 +2989,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(SerialiserType &ser, HAND
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -406,6 +406,8 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId
|
||||
D3D11ResourceType type = Resource_Unknown;
|
||||
ResourceId Id = ResourceId();
|
||||
|
||||
bool ret = true;
|
||||
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
type = IdentifyTypeByPtr(res);
|
||||
@@ -645,6 +647,7 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId
|
||||
{
|
||||
RDCERR("Failed to create staging resource for Texture1D initial contents HRESULT: %s",
|
||||
ToStr(hr).c_str());
|
||||
ret = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -819,6 +822,7 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId
|
||||
{
|
||||
RDCERR("Failed to create staging resource for Texture2D initial contents HRESULT: %s",
|
||||
ToStr(hr).c_str());
|
||||
ret = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -969,6 +973,7 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId
|
||||
{
|
||||
RDCERR("Failed to create staging resource for Texture3D initial contents HRESULT: %s",
|
||||
ToStr(hr).c_str());
|
||||
ret = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -988,7 +993,7 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId
|
||||
RDCERR("Trying to serialise initial state of unsupported resource type");
|
||||
}
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WrappedID3D11Device::Create_InitialState(ResourceId id, ID3D11DeviceChild *live, bool hasData)
|
||||
|
||||
@@ -215,7 +215,10 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser,
|
||||
(void **)&list);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, hr: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if(partial)
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@ bool WrappedID3D12Device::Serialise_CreateCommandQueue(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -151,6 +152,7 @@ bool WrappedID3D12Device::Serialise_CreateCommandAllocator(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -235,6 +237,7 @@ bool WrappedID3D12Device::Serialise_CreateCommandList(SerialiserType &ser, UINT
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else if(list)
|
||||
{
|
||||
@@ -337,6 +340,7 @@ bool WrappedID3D12Device::Serialise_CreateGraphicsPipelineState(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -541,6 +545,7 @@ bool WrappedID3D12Device::Serialise_CreateComputePipelineState(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -651,6 +656,7 @@ bool WrappedID3D12Device::Serialise_CreateDescriptorHeap(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -738,6 +744,7 @@ bool WrappedID3D12Device::Serialise_CreateRootSignature(SerialiserType &ser, UIN
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1174,6 +1181,7 @@ bool WrappedID3D12Device::Serialise_CreateCommittedResource(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1312,6 +1320,7 @@ bool WrappedID3D12Device::Serialise_CreateHeap(SerialiserType &ser, const D3D12_
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1407,6 +1416,7 @@ bool WrappedID3D12Device::Serialise_CreatePlacedResource(
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1567,6 +1577,7 @@ bool WrappedID3D12Device::Serialise_CreateFence(SerialiserType &ser, UINT64 Init
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1641,6 +1652,7 @@ bool WrappedID3D12Device::Serialise_CreateQueryHeap(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1719,6 +1731,7 @@ bool WrappedID3D12Device::Serialise_CreateCommandSignature(SerialiserType &ser,
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, HRESULT: %s", ToStr(hr).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -303,6 +303,8 @@ bool D3D12ResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceI
|
||||
initContents = GetInitialContents(resid);
|
||||
}
|
||||
|
||||
bool ret = true;
|
||||
|
||||
SERIALISE_ELEMENT_LOCAL(id, resid);
|
||||
SERIALISE_ELEMENT_LOCAL(type, record->type);
|
||||
|
||||
@@ -401,6 +403,7 @@ bool D3D12ResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceI
|
||||
mappedBuffer = NULL;
|
||||
|
||||
RDCERR("Failed to map buffer for readback! %s", ToStr(hr).c_str());
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -455,6 +458,7 @@ bool D3D12ResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceI
|
||||
if(FAILED(hr))
|
||||
{
|
||||
RDCERR("Created but couldn't map upload buffer: %s", ToStr(hr).c_str());
|
||||
ret = false;
|
||||
SAFE_RELEASE(copySrc);
|
||||
mappedBuffer = NULL;
|
||||
ResourceContents = NULL;
|
||||
@@ -463,6 +467,7 @@ bool D3D12ResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceI
|
||||
else
|
||||
{
|
||||
RDCERR("Couldn't create upload buffer: %s", ToStr(hr).c_str());
|
||||
ret = false;
|
||||
mappedBuffer = NULL;
|
||||
ResourceContents = NULL;
|
||||
}
|
||||
@@ -495,7 +500,7 @@ bool D3D12ResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceI
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template bool D3D12ResourceManager::Serialise_InitialState(ReadSerialiser &ser, ResourceId resid,
|
||||
|
||||
@@ -518,6 +518,7 @@ void VulkanCreationInfo::Framebuffer::Init(VulkanResourceManager *resourceMan,
|
||||
void VulkanCreationInfo::Memory::Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
|
||||
const VkMemoryAllocateInfo *pAllocInfo)
|
||||
{
|
||||
memoryTypeIndex = pAllocInfo->memoryTypeIndex;
|
||||
size = pAllocInfo->allocationSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -265,6 +265,7 @@ struct VulkanCreationInfo
|
||||
void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
|
||||
const VkMemoryAllocateInfo *pAllocInfo);
|
||||
|
||||
uint32_t memoryTypeIndex;
|
||||
uint64_t size;
|
||||
|
||||
VkBuffer wholeMemBuf;
|
||||
|
||||
@@ -528,6 +528,8 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
|
||||
type = IdentifyTypeByPtr(record->Resource);
|
||||
}
|
||||
|
||||
bool ret = true;
|
||||
|
||||
SERIALISE_ELEMENT(type);
|
||||
SERIALISE_ELEMENT(id);
|
||||
|
||||
@@ -696,7 +698,11 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
|
||||
writes[i].pBufferInfo = dstBuffer;
|
||||
break;
|
||||
}
|
||||
default: RDCERR("Unexpected descriptor type %d", writes[i].descriptorType);
|
||||
default:
|
||||
{
|
||||
RDCERR("Unexpected descriptor type %d", writes[i].descriptorType);
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,12 +735,17 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
|
||||
|
||||
if(IsSparse)
|
||||
{
|
||||
bool ret = false;
|
||||
ret = false;
|
||||
|
||||
if(type == eResImage)
|
||||
{
|
||||
ret = Serialise_SparseImageInitialState(ser, id, initContents);
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCERR("Invalid initial state - sparse marker for device memory");
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1021,9 +1032,10 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
|
||||
else
|
||||
{
|
||||
RDCERR("Unhandled resource type %s", ToStr(type).c_str());
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template bool WrappedVulkan::Serialise_InitialState(ReadSerialiser &ser, ResourceId resid,
|
||||
|
||||
@@ -337,6 +337,7 @@ bool WrappedVulkan::Serialise_vkCreateCommandPool(SerialiserType &ser, VkDevice
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -428,6 +429,7 @@ bool WrappedVulkan::Serialise_vkAllocateCommandBuffers(SerialiserType &ser, VkDe
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -617,6 +619,7 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(SerialiserType &ser, VkComman
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -681,6 +684,7 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(SerialiserType &ser, VkComman
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -176,6 +176,7 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorPool(SerialiserType &ser, VkDevi
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -249,6 +250,7 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorSetLayout(
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -372,6 +374,7 @@ bool WrappedVulkan::Serialise_vkAllocateDescriptorSets(SerialiserType &ser, VkDe
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -409,6 +409,7 @@ bool WrappedVulkan::Serialise_vkCreateSampler(SerialiserType &ser, VkDevice devi
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,6 +500,7 @@ bool WrappedVulkan::Serialise_vkCreateFramebuffer(SerialiserType &ser, VkDevice
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -705,6 +707,7 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(SerialiserType &ser, VkDevice d
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -891,6 +894,7 @@ bool WrappedVulkan::Serialise_vkCreateQueryPool(SerialiserType &ser, VkDevice de
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -166,6 +166,7 @@ bool WrappedVulkan::Serialise_vkAllocateMemory(SerialiserType &ser, VkDevice dev
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -857,11 +858,60 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory(SerialiserType &ser, VkDevice d
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
{
|
||||
ObjDisp(device)->BindBufferMemory(Unwrap(device), Unwrap(buffer), Unwrap(memory), memoryOffset);
|
||||
|
||||
ResourceId resOrigId = GetResourceManager()->GetOriginalID(GetResID(buffer));
|
||||
ResourceId memOrigId = GetResourceManager()->GetOriginalID(GetResID(memory));
|
||||
|
||||
// verify that the memory meets basic requirements. If not, something changed and we should bail
|
||||
// loading this capture. This is a bit of an under-estimate since we just make sure there's
|
||||
// enough space left in the memory, that doesn't mean that there aren't overlaps due to
|
||||
// increased size requirements.
|
||||
VkMemoryRequirements mrq = {};
|
||||
ObjDisp(device)->GetBufferMemoryRequirements(Unwrap(device), Unwrap(buffer), &mrq);
|
||||
|
||||
VulkanCreationInfo::Memory &memInfo = m_CreationInfo.m_Memory[GetResID(memory)];
|
||||
uint32_t bit = 1U << memInfo.memoryTypeIndex;
|
||||
|
||||
// verify type
|
||||
if((mrq.memoryTypeBits & bit) == 0)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind buffer %llu to memory %llu which is type %u, "
|
||||
"but only these types are allowed: %08x.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memInfo.memoryTypeIndex, mrq.memoryTypeBits);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
// verify offset alignment
|
||||
if((memoryOffset & mrq.alignment) != 0)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind buffer %llu to memory %llu which is type %u, "
|
||||
"but offset 0x%llx doesn't satisfy alignment 0x%llx.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memoryOffset, mrq.alignment);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
// verify size
|
||||
if(mrq.size > memInfo.size - memoryOffset)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind buffer %llu to memory %llu which is type %u, "
|
||||
"but at offset 0x%llx the reported size of 0x%llx won't fit the 0x%llx bytes of memory.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memoryOffset, mrq.size, memInfo.size);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjDisp(device)->BindBufferMemory(Unwrap(device), Unwrap(buffer), Unwrap(memory), memoryOffset);
|
||||
|
||||
GetReplay()->GetResourceDesc(memOrigId).derivedResources.push_back(resOrigId);
|
||||
GetReplay()->GetResourceDesc(resOrigId).parentResources.push_back(memOrigId);
|
||||
|
||||
@@ -916,11 +966,60 @@ bool WrappedVulkan::Serialise_vkBindImageMemory(SerialiserType &ser, VkDevice de
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
{
|
||||
ObjDisp(device)->BindImageMemory(Unwrap(device), Unwrap(image), Unwrap(memory), memoryOffset);
|
||||
|
||||
ResourceId resOrigId = GetResourceManager()->GetOriginalID(GetResID(image));
|
||||
ResourceId memOrigId = GetResourceManager()->GetOriginalID(GetResID(memory));
|
||||
|
||||
// verify that the memory meets basic requirements. If not, something changed and we should bail
|
||||
// loading this capture. This is a bit of an under-estimate since we just make sure there's
|
||||
// enough space left in the memory, that doesn't mean that there aren't overlaps due to
|
||||
// increased size requirements.
|
||||
VkMemoryRequirements mrq = {};
|
||||
ObjDisp(device)->GetImageMemoryRequirements(Unwrap(device), Unwrap(image), &mrq);
|
||||
|
||||
VulkanCreationInfo::Memory &memInfo = m_CreationInfo.m_Memory[GetResID(memory)];
|
||||
uint32_t bit = 1U << memInfo.memoryTypeIndex;
|
||||
|
||||
// verify type
|
||||
if((mrq.memoryTypeBits & bit) == 0)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind image %llu to memory %llu which is type %u, "
|
||||
"but only these types are allowed: %08x.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memInfo.memoryTypeIndex, mrq.memoryTypeBits);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
// verify offset alignment
|
||||
if((memoryOffset & mrq.alignment) != 0)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind image %llu to memory %llu which is type %u, "
|
||||
"but offset 0x%llx doesn't satisfy alignment 0x%llx.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memoryOffset, mrq.alignment);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
// verify size
|
||||
if(mrq.size > memInfo.size - memoryOffset)
|
||||
{
|
||||
RDCERR(
|
||||
"Trying to bind image %llu to memory %llu which is type %u, "
|
||||
"but at offset 0x%llx the reported size of 0x%llx won't fit the 0x%llx bytes of memory.\n"
|
||||
"This is most likely caused by incompatible hardware or drivers between capture and "
|
||||
"replay, causing a change in memory requirements.",
|
||||
resOrigId, memOrigId, memoryOffset, mrq.size, memInfo.size);
|
||||
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported;
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjDisp(device)->BindImageMemory(Unwrap(device), Unwrap(image), Unwrap(memory), memoryOffset);
|
||||
|
||||
GetReplay()->GetResourceDesc(memOrigId).derivedResources.push_back(resOrigId);
|
||||
GetReplay()->GetResourceDesc(resOrigId).parentResources.push_back(memOrigId);
|
||||
|
||||
@@ -993,6 +1092,7 @@ bool WrappedVulkan::Serialise_vkCreateBuffer(SerialiserType &ser, VkDevice devic
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1098,6 +1198,7 @@ bool WrappedVulkan::Serialise_vkCreateBufferView(SerialiserType &ser, VkDevice d
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1227,6 +1328,7 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1511,6 +1613,7 @@ bool WrappedVulkan::Serialise_vkCreateImageView(SerialiserType &ser, VkDevice de
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -113,6 +113,7 @@ bool WrappedVulkan::Serialise_vkCreatePipelineLayout(SerialiserType &ser, VkDevi
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -215,6 +216,7 @@ bool WrappedVulkan::Serialise_vkCreateShaderModule(SerialiserType &ser, VkDevice
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -310,6 +312,7 @@ bool WrappedVulkan::Serialise_vkCreatePipelineCache(SerialiserType &ser, VkDevic
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -404,6 +407,7 @@ bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -580,6 +584,7 @@ bool WrappedVulkan::Serialise_vkCreateComputePipelines(SerialiserType &ser, VkDe
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -91,6 +91,7 @@ bool WrappedVulkan::Serialise_vkCreateFence(SerialiserType &ser, VkDevice device
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -286,6 +287,7 @@ bool WrappedVulkan::Serialise_vkCreateEvent(SerialiserType &ser, VkDevice device
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,6 +468,7 @@ bool WrappedVulkan::Serialise_vkCreateSemaphore(SerialiserType &ser, VkDevice de
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: %s", ToStr(ret).c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user