Fix corruption when calling GetDetails() on non-shader

This commit is contained in:
baldurk
2018-01-16 21:00:10 +00:00
parent dea21b20a0
commit 413438c627
+4 -3
View File
@@ -294,12 +294,13 @@ TextureDescription D3D12Replay::GetTexture(ResourceId id)
rdcarray<ShaderEntryPoint> D3D12Replay::GetShaderEntryPoints(ResourceId shader)
{
WrappedID3D12Shader *sh =
m_pDevice->GetResourceManager()->GetCurrentAs<WrappedID3D12Shader>(shader);
ID3D12DeviceChild *res = m_pDevice->GetResourceManager()->GetCurrentResource(shader);
if(!sh)
if(!res || !WrappedID3D12Shader::IsAlloc(res))
return {};
WrappedID3D12Shader *sh = (WrappedID3D12Shader *)res;
ShaderReflection &ret = sh->GetDetails();
return {{"main", ret.stage}};