Files
UnrealEngineUWP/Engine/Source/Developer/ProjectLauncher/Private/Widgets/Package/SProjectLauncherPackagePage.cpp
Dan Thompson 3a6321167b Packaging Reference Chunk Database - "Lossless Patch Preventer"
Can now provide reference iostore containers to reuse compressed chunks from. If a match is found on *the decompressed data*, instead of recompressing the blocks, they are read off of disk. This allows tweaks of the compressor algorithm without introducing changes as the runtime still sees the exact same data. Additionally this allows for fairly dramatic staging speedups as nvme speeds are significantly faster than high effort compressions. This is distinct from the DDC compression because:
1) DDC compression ties in the compressor version/method
2) We are explicitly interested in chunks that are deployed to end users, not merely cached for speed.

To facilitate this, several changes were made to IoStore:

FIoStoreReader now directly reads from IFileHandles* instead of routing through the GenericPlatformFile async read system, as that system is sensitive to build #defines and can result in constant file opens under load (indeed, for anything not a .pak file, every read is an open/close).

Cold file cache read speed improvements from ~140MB/s to ~1 GB/s. Hot is more.

Additionally:
    FIoStoreReader switched to UE::Tasks from taskgraph for tasks in order to facilitate task retraction during waits as the previous ReadAsync call was trivial to deadlock when called from worker threads due to its use of TFuture<>.
    FIoStoreReader::ReadCompressed now returns the compressed blocks as they were on disk - padded to AES encryption block size.

#rb fabian.giesen
#rb jeff.roberts
#preflight 627586dcf77c9c2b543d4d8b

[CL 20086673 by Dan Thompson in ue5-main branch]
2022-05-06 18:22:44 -04:00

171 lines
5.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SProjectLauncherPackagePage.h"
#include "Framework/Commands/UIAction.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "Textures/SlateIcon.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Input/SComboButton.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Package/SProjectLauncherPackagingSettings.h"
#define LOCTEXT_NAMESPACE "SProjectLauncherPackagePage"
/* SProjectLauncherPackagePage structors
*****************************************************************************/
SProjectLauncherPackagePage::~SProjectLauncherPackagePage()
{
if (Model.IsValid())
{
Model->OnProfileSelected().RemoveAll(this);
}
}
/* SProjectLauncherPackagePage interface
*****************************************************************************/
void SProjectLauncherPackagePage::Construct(const FArguments& InArgs, const TSharedRef<FProjectLauncherModel>& InModel)
{
Model = InModel;
// create packing mode menu
FMenuBuilder PackagingModeMenuBuilder(true, NULL);
{
FUIAction LocallyAction(FExecuteAction::CreateSP(this, &SProjectLauncherPackagePage::HandlePackagingModeMenuEntryClicked, ELauncherProfilePackagingModes::Locally));
PackagingModeMenuBuilder.AddMenuEntry(LOCTEXT("LocallyAction", "Package & store locally"), LOCTEXT("LocallyActionHint", "Store this build locally."), FSlateIcon(), LocallyAction);
FUIAction SharedRepositoryAction(FExecuteAction::CreateSP(this, &SProjectLauncherPackagePage::HandlePackagingModeMenuEntryClicked, ELauncherProfilePackagingModes::SharedRepository));
PackagingModeMenuBuilder.AddMenuEntry(LOCTEXT("SharedRepositoryAction", "Package & store in repository"), LOCTEXT("SharedRepositoryActionHint", "Store this build in a shared repository."), FSlateIcon(), SharedRepositoryAction);
FUIAction DoNotPackageAction(FExecuteAction::CreateSP(this, &SProjectLauncherPackagePage::HandlePackagingModeMenuEntryClicked, ELauncherProfilePackagingModes::DoNotPackage));
PackagingModeMenuBuilder.AddMenuEntry(LOCTEXT("DoNotPackageAction", "Do not package"), LOCTEXT("DoNotPackageActionHint", "Do not package the build at this time."), FSlateIcon(), DoNotPackageAction);
}
ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.0)
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(LOCTEXT("WhereToStoreBuildText", "How would you like to package the build?"))
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(8.0, 0.0, 0.0, 0.0)
[
// packaging mode menu
SNew(SComboButton)
.ButtonContent()
[
SNew(STextBlock)
.Text(this, &SProjectLauncherPackagePage::HandlePackagingModeComboButtonContentText)
]
.ContentPadding(FMargin(6.0, 2.0))
.MenuContent()
[
PackagingModeMenuBuilder.MakeWidget()
]
]
]
+ SVerticalBox::Slot()
.FillHeight(1.0)
.Padding(0.0, 8.0, 0.0, 0.0)
[
SAssignNew(ProjectLauncherPackagingSettings, SProjectLauncherPackagingSettings, InModel)
.Visibility(this, &SProjectLauncherPackagePage::HandlePackagingSettingsAreaVisibility)
]
];
Model->OnProfileSelected().AddSP(this, &SProjectLauncherPackagePage::HandleProfileManagerProfileSelected);
}
/* SProjectLauncherLaunchPage callbacks
*****************************************************************************/
FText SProjectLauncherPackagePage::HandlePackagingModeComboButtonContentText() const
{
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
if (SelectedProfile.IsValid())
{
ELauncherProfilePackagingModes::Type PackagingMode = SelectedProfile->GetPackagingMode();
if (PackagingMode == ELauncherProfilePackagingModes::DoNotPackage)
{
return LOCTEXT("DoNotPackageAction", "Do not package");
}
if (PackagingMode == ELauncherProfilePackagingModes::Locally)
{
return LOCTEXT("LocallyAction", "Package & store locally");
}
if (PackagingMode == ELauncherProfilePackagingModes::SharedRepository)
{
return LOCTEXT("SharedRepositoryAction", "Package & store in repository");
}
return LOCTEXT("PackagingModeComboButtonDefaultText", "Select...");
}
return FText::GetEmpty();
}
void SProjectLauncherPackagePage::HandlePackagingModeMenuEntryClicked(ELauncherProfilePackagingModes::Type PackagingMode)
{
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
if (SelectedProfile.IsValid())
{
SelectedProfile->SetPackagingMode(PackagingMode);
check(ProjectLauncherPackagingSettings.IsValid());
ProjectLauncherPackagingSettings->UpdatePackagingModeWidgets();
}
}
EVisibility SProjectLauncherPackagePage::HandlePackagingSettingsAreaVisibility() const
{
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
if (SelectedProfile.IsValid())
{
ELauncherProfilePackagingModes::Type PackagingMode = SelectedProfile->GetPackagingMode();
if ((PackagingMode == ELauncherProfilePackagingModes::Locally) || (PackagingMode == ELauncherProfilePackagingModes::SharedRepository))
{
return EVisibility::Visible;
}
}
return EVisibility::Collapsed;
}
void SProjectLauncherPackagePage::HandleProfileManagerProfileSelected(const ILauncherProfilePtr& SelectedProfile, const ILauncherProfilePtr& PreviousProfile)
{
}
#undef LOCTEXT_NAMESPACE