Files
UnrealEngineUWP/Engine/Source/Developer/Virtualization/Internal/VirtualizationExperimentalUtilities.h
paul chipchase 76775be2b6 Add a way for us to find any EPayloadFilterReason that might be applied to a payload during the virtualization process.
#rb Per.Larsson
#rnx

- Currently we apply filtering to payloads at two points, package save and during virtualization. The reasons applied during package save are stored int he payload trailer and are easy to access when making reports but we needed a way to find the second set of filters.
- This set up is fairly hacky as we are accessing the default FVirtualizationManager directly, this is because I wanted to avoid making a public interface change as I am not 100% sure that we should be trying to fix filtering this way and am leaning towards either moving all filtering to a single point (both have their advantages and disadvantages) or making the difference between these two stages more explicit and for either solution I don't want to be tied to any interface changes we'd need to make here.
- The new utilities header I added is internal so we can change it as we need, it is also marked as experimental so licensees should be avoiding it anyway.

[CL 35335884 by paul chipchase in ue5-main branch]
2024-08-06 05:03:43 -04:00

31 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Virtualization/VirtualizationSystem.h"
/**
* The functions in this header are not set in stone and are likely to be changed without warning.
* Once they are finalized they can be moved to the public utils header for general use.
*/
namespace UE::Virtualization::Utils
{
/**
* Adds filter reasons for a package that would only be calculated during the virtualization process and not stored in the payload trailer
* Currently this is used to fix up reporting in our commandlets and console commands so that it is easier for users to see why payloads
* have not been virtualized. This is only required because some filters are applied at package save time (when we know the owning asset
* type) and others at submit time.
* The two stage filtering does need fixing properly but I am not sure which way we want to do it, this is why we have an experimental
* utility to fix the reporting as I do not want to commit to an API change while still unsure on the direction we should take.
*
* NOTE: Only works if the "Default" virtualization system is used.
*
* @param PackagePath Used to check for EPayloadFilterReason::Path
* @param SizeOnDisk Used to check for EPayloadFilterReason::MinSize
* @param CurrentFilterFlags The filters for the payload stored in the payload trailer.
* @return The final filter reason used by the payload during the virtualization process.
*/
VIRTUALIZATION_API EPayloadFilterReason FixFilterFlags(FStringView PackagePath, uint64 SizeOnDisk, EPayloadFilterReason CurrentFilterFlags);
} //namespace UE::Virtualization::Utils