Fix shader function being called on non-shaders corrupting memory

This commit is contained in:
baldurk
2020-09-24 22:28:58 +01:00
parent 3c39f17d22
commit 2d7a717e2d
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -410,6 +410,9 @@ TextureDescription D3D12Replay::GetTexture(ResourceId id)
rdcarray<ShaderEntryPoint> D3D12Replay::GetShaderEntryPoints(ResourceId shader)
{
if(!WrappedID3D12Shader::IsShader(shader))
return {};
ID3D12DeviceChild *res = m_pDevice->GetResourceManager()->GetCurrentResource(shader);
if(!res)
+9
View File
@@ -714,6 +714,15 @@ public:
shader->Release();
}
static bool IsShader(ResourceId id)
{
for(auto it = m_Shaders.begin(); it != m_Shaders.end(); ++it)
if(it->second->GetResourceID() == id)
return true;
return false;
}
DXBCKey GetKey() { return m_Key; }
D3D12_SHADER_BYTECODE GetDesc()
{