| 1026 | }; |
| 1027 | |
| 1028 | bool CookAssetsStep::Perform(CookingData& data) |
| 1029 | { |
| 1030 | float Step1ProgressStart = 0.1f; |
| 1031 | float Step1ProgressEnd = 0.6f; |
| 1032 | String Step1Info = TEXT("Cooking assets"); |
| 1033 | float Step2ProgressStart = Step1ProgressEnd; |
| 1034 | float Step2ProgressEnd = 0.8f; |
| 1035 | String Step2Info = TEXT("Cooking files"); |
| 1036 | float Step3ProgressStart = Step2ProgressStart; |
| 1037 | float Step3ProgressEnd = 0.9f; |
| 1038 | String Step3Info = TEXT("Packaging assets"); |
| 1039 | |
| 1040 | data.StepProgress(TEXT("Loading build cache"), 0); |
| 1041 | |
| 1042 | // Prepare |
| 1043 | const auto gameSettings = GameSettings::Get(); |
| 1044 | const auto buildSettings = BuildSettings::Get(); |
| 1045 | const int32 contentKey = buildSettings->ContentKey == 0 ? rand() : buildSettings->ContentKey; |
| 1046 | AssetsRegistry.Clear(); |
| 1047 | AssetPathsMapping.Clear(); |
| 1048 | |
| 1049 | // Load incremental build cache |
| 1050 | CacheData cache; |
| 1051 | cache.Load(data); |
| 1052 | |
| 1053 | // Update build settings |
| 1054 | #if PLATFORM_TOOLS_WINDOWS |
| 1055 | { |
| 1056 | const auto settings = WindowsPlatformSettings::Get(); |
| 1057 | cache.Settings.Windows.SupportDX12 = settings->SupportDX12; |
| 1058 | cache.Settings.Windows.SupportDX11 = settings->SupportDX11; |
| 1059 | cache.Settings.Windows.SupportDX10 = settings->SupportDX10; |
| 1060 | cache.Settings.Windows.SupportVulkan = settings->SupportVulkan; |
| 1061 | } |
| 1062 | #endif |
| 1063 | #if PLATFORM_TOOLS_UWP |
| 1064 | { |
| 1065 | const auto settings = UWPPlatformSettings::Get(); |
| 1066 | cache.Settings.UWP.SupportDX11 = settings->SupportDX11; |
| 1067 | cache.Settings.UWP.SupportDX10 = settings->SupportDX10; |
| 1068 | } |
| 1069 | #endif |
| 1070 | #if PLATFORM_TOOLS_LINUX |
| 1071 | { |
| 1072 | const auto settings = LinuxPlatformSettings::Get(); |
| 1073 | cache.Settings.Linux.SupportVulkan = settings->SupportVulkan; |
| 1074 | } |
| 1075 | #endif |
| 1076 | { |
| 1077 | cache.Settings.Global.ShadersNoOptimize = buildSettings->ShadersNoOptimize; |
| 1078 | cache.Settings.Global.ShadersGenerateDebugData = buildSettings->ShadersGenerateDebugData; |
| 1079 | cache.Settings.Global.StreamingSettingsAssetId = gameSettings->Streaming; |
| 1080 | cache.Settings.Global.ShadersVersion = GPU_SHADER_CACHE_VERSION; |
| 1081 | cache.Settings.Global.MaterialGraphVersion = MATERIAL_GRAPH_VERSION; |
| 1082 | cache.Settings.Global.ParticleGraphVersion = PARTICLE_GPU_GRAPH_VERSION; |
| 1083 | } |
| 1084 | |
| 1085 | // Note: this step converts all the assets (even the json) into the binary files (FlaxStorage format). |
nothing calls this directly
no test coverage detected