mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 22:55:41 +00:00
Fix shader function being called on non-shaders corrupting memory
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user