const TArray<FName>& GetTargetShaderFormats() { static bool bInit = false; static TArray<FName> Results; #if WITH_ENGINE if (!bInit) { bInit = true; ITargetPlatformManagerModule* TPM = GetTargetPlatformManager(); if (!TPM || TPM->RestrictFormatsToRuntimeOnly()) { // for now a runtime format and a cook format are very different, we don't put any formats here } else { const TArray<ITargetPlatform*>& Platforms = TPM->GetActiveTargetPlatforms(); for (int32 Index = 0; Index < Platforms.Num(); Index++) { Platforms[Index]->GetAllTargetedShaderFormats(Results); } } } #endif // WITH_ENGINE return Results; }
void USoundWave::BeginCachePlatformData() { CachePlatformData(true); #if WITH_EDITOR // enable caching in postload for derived data cache commandlet and cook by the book ITargetPlatformManagerModule* TPM = GetTargetPlatformManager(); if (TPM && (TPM->RestrictFormatsToRuntimeOnly() == false)) { TArray<ITargetPlatform*> Platforms = TPM->GetActiveTargetPlatforms(); // Cache for all the audio formats that the cooking target requires for (int32 FormatIndex = 0; FormatIndex < Platforms.Num(); FormatIndex++) { BeginCacheForCookedPlatformData(Platforms[FormatIndex]); } } #endif }