Description

Here is a snap shot of the propose UDN change:

TRACE_CPUPROFILER_EVENT_SCOPE(ValidateTextureOverridesForPIE);
TSet<UMaterialInterface*> ProcessedMaterials;TArray<UPrimitiveComponent*> Components;
for (const TObjectPtr<AActor>& Actor : Level->Actors)
{
    if (nullptr != Actor)
    {
        Actor->GetComponents<UPrimitiveComponent>(Components);
        for (UPrimitiveComponent* Component : Components)
        {
            TArray<UMaterialInterface*> Materials;
            Component->GetUsedMaterials(Materials);
            for (UMaterialInterface* Material : Materials)
            {
                bool bIsAlreadyInSet = false;
                ProcessedMaterials.FindOrAdd(Material, &bIsAlreadyInSet);
                if (!bIsAlreadyInSet)
                {
                    if (UMaterialInstance* MaterialInstance = Cast<UMaterialInstance>(Material))
                    {
                        MaterialInstance->ValidateTextureOverrides(FeatureLevel);
                    }
                }
            }
        }
    }
} 
Steps to Reproduce

start a PIE

the lambda ValidateTextureOverridesForPIE iterate all primitive component instead of iterating actor which is a lot slower.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-220455 in the post.

0
Login to Vote

Fixed
Fix Commit37793484
CreatedJul 29, 2024
ResolvedNov 5, 2024
UpdatedNov 6, 2024
View Jira Issue