Added "RemovePassTemplate" method. (#5039)
* Added "RemovePassTemplate" method. Signed-off-by: garrieta <garrieta@amazon.com> * RemovePassTemplate only allows to remove PassTemplates created with the Runtime API. It now asserts if there are Passes referencing the PassTemplate that should be removed. Signed-off-by: garrieta <garrieta@amazon.com>
This commit is contained in:
@@ -236,6 +236,19 @@ namespace AZ
|
||||
return true;
|
||||
}
|
||||
|
||||
void PassLibrary::RemovePassTemplate(const Name& name)
|
||||
{
|
||||
auto itr = m_templateEntries.find(name);
|
||||
if (itr != m_templateEntries.end())
|
||||
{
|
||||
AZ_Assert(itr->second.m_passes.empty(), "Can not delete PassTemplate '%s' because there are %zu Passes referencing it",
|
||||
name.GetCStr(), itr->second.m_passes.size());
|
||||
AZ_Assert(!itr->second.m_mappingAssetId.IsValid(), "Can not delete PassTemplate '%s' because it was created from an asset",
|
||||
name.GetCStr());
|
||||
m_templateEntries.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void PassLibrary::RemovePassFromLibrary(Pass* pass)
|
||||
{
|
||||
if (m_isShuttingDown)
|
||||
|
||||
Reference in New Issue
Block a user