Atom/qingtao/atom 16135 (#7334)
* Changes to AttachmentImage related classes to have better support using render target as texture. - Updated AttachmentImageAsset to support an unique name which can be used as AttachmentId. - Functions in ImageSystemInterface to find an AttachmentImage by its unique name. - Added InsertChild function to ParentPass class so it can insert a child pass at any location. - Change to ImageAttachmentPreviewPass so it can preview cached pass attachment even the source pass was disabled. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <Atom/RPI.Reflect/Image/AttachmentImageAssetCreator.h>
|
||||
#include <Atom/RPI.Public/Image/AttachmentImagePool.h>
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
|
||||
@@ -47,8 +49,7 @@ namespace AZ
|
||||
{
|
||||
if (ValidateIsReady())
|
||||
{
|
||||
m_asset->m_isClearValueValid = true;
|
||||
m_asset->m_optimizedClearValue = clearValue;
|
||||
m_asset->m_optimizedClearValue = AZStd::make_shared<RHI::ClearValue>(clearValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +60,11 @@ namespace AZ
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate assetId instead of validate AssetData* exist. This is mainly because the Asset<T> 's serializer only need serialize asset id instead of asset data
|
||||
// Instead of create a complete Asset<T>, we could use new Asset(assetId, type, hint) to create a placeholder to save the asset id for serialization.
|
||||
// If the pool wasn't provided, use the system default attachment pool
|
||||
if (!m_asset->m_poolAsset.GetId().IsValid())
|
||||
{
|
||||
ReportError("You must assign a pool asset before calling End().");
|
||||
return false;
|
||||
Data::Instance<RPI::AttachmentImagePool> pool = RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool();
|
||||
m_asset->m_poolAsset = {pool->GetAssetId(), azrtti_typeid<ResourcePoolAsset>()};
|
||||
}
|
||||
|
||||
m_asset->SetReady();
|
||||
@@ -75,5 +75,20 @@ namespace AZ
|
||||
{
|
||||
m_asset.SetHint(hint);
|
||||
}
|
||||
|
||||
void AttachmentImageAssetCreator::SetName(const AZ::Name& uniqueName, bool isUniqueName)
|
||||
{
|
||||
if (uniqueName.IsEmpty())
|
||||
{
|
||||
m_asset->m_isUniqueName = false;
|
||||
AZ_Warning("RPI", false, "Can't set empty string as unique name");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_asset->m_isUniqueName = isUniqueName;
|
||||
}
|
||||
m_asset->m_name = uniqueName;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user