Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataChunk.h
Devin Doucette a077feffbd DDC: Reworked ICacheStore to allow partial records, filtering of payloads, and loading parts of payloads
- ICacheStore::Put() has updated documentation to reflect the requirements of partial records.
- ICacheStore::Get() now takes a FCacheRecordPolicy, which is implicitly constructible from ECachePolicy, and allows setting the policy by payload.
- ICacheStore::GetPayload() is replaced by ICacheStore::GetChunks(), which allows loading parts of payloads.
- ICacheStore::CancelAll() is moved to ICache::CancelAll() because the cache can track requests at the top level and cancel them without exposing cancellation on individual cache stores.
- ECachePolicy::SkipLocalCopy has been removed because it is difficult to reason about.
- ECachePolicy::SkipData flags now have a documented meaning for put requests, to hint that record existence implies payload existence.
- The filesystem and memory cache stores have been updated to support partial records, filtering of payloads, and loading parts of payloads.
- Requesting part of a payload will decompress the entire payload for now, until compressed buffers expose a way to decompress only part.
- Fixed a bug in FTexturePlatformData::AreDerivedMipsAvailable() that caused it to return false for structured cache keys.

#rb Zousar.Shaker
#rnx
#preflight 615e03241ed62f0001b95454

#ROBOMERGE-OWNER: Devin.Doucette
#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 17748550 in //UE5/Release-5.0/... via CL 17748555
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE-CONFLICT from-shelf
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17748602 by Devin Doucette in ue5-release-engine-test branch]
2021-10-07 09:11:32 -04:00

46 lines
889 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
namespace UE::DerivedData
{
/** Binary predicate that compares chunks by key, then payload ID, then raw offset. */
struct TChunkEqual
{
template <typename ChunkTypeA, typename ChunkTypeB>
inline bool operator()(ChunkTypeA&& A, ChunkTypeB&& B) const
{
return A.Key == B.Key && A.Id == B.Id && A.RawOffset == B.RawOffset;
}
};
/** Binary predicate that compares chunks by key, then payload ID, then raw offset. */
struct TChunkLess
{
template <typename ChunkTypeA, typename ChunkTypeB>
inline bool operator()(ChunkTypeA&& A, ChunkTypeB&& B) const
{
if (A.Key < B.Key)
{
return true;
}
if (B.Key < A.Key)
{
return false;
}
if (A.Id < B.Id)
{
return true;
}
if (B.Id < A.Id)
{
return false;
}
return A.RawOffset < B.RawOffset;
}
};
} // UE::DerivedData