In the original code, there are chances to compare an iterator from m_CBsByName to m_StructuredBufferCBsByName.end(). It crashes if _ITERATOR_DEBUG_LEVEL is not 0. Fix it by comparing an iterator to the container it's from. (#3160)
Co-authored-by: Minmin Gong <mgong@microsoft.com>
This commit is contained in:
Родитель
de63c27429
Коммит
65155d95bd
|
@ -2323,11 +2323,19 @@ ID3D12ShaderReflectionConstantBuffer* DxilModuleReflection::_GetConstantBufferBy
|
||||||
return &g_InvalidSRConstantBuffer;
|
return &g_InvalidSRConstantBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t index = m_CBs.size();
|
||||||
auto it = m_CBsByName.find(Name);
|
auto it = m_CBsByName.find(Name);
|
||||||
if (it == m_CBsByName.end())
|
if (it != m_CBsByName.end()) {
|
||||||
|
index = it->second;
|
||||||
|
} else {
|
||||||
it = m_StructuredBufferCBsByName.find(Name);
|
it = m_StructuredBufferCBsByName.find(Name);
|
||||||
if (it != m_StructuredBufferCBsByName.end())
|
if (it != m_StructuredBufferCBsByName.end()) {
|
||||||
return m_CBs[it->second].get();
|
index = it->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index < m_CBs.size()) {
|
||||||
|
return m_CBs[index].get();
|
||||||
|
}
|
||||||
|
|
||||||
return &g_InvalidSRConstantBuffer;
|
return &g_InvalidSRConstantBuffer;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче