Add support for Game Cooker on Linux

This commit is contained in:
Wojtek Figat
2021-03-11 22:39:03 +01:00
parent b04321bdd2
commit b4dcaef61a
4 changed files with 51 additions and 8 deletions

View File

@@ -101,7 +101,7 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c
// Deploy files
Array<String> files(16);
const String outputPath = StringUtils::GetDirectoryName(path);
FileSystem::DirectoryGetFiles(files, outputPath, TEXT("*.*"), DirectorySearchOption::TopDirectoryOnly);
FileSystem::DirectoryGetFiles(files, outputPath, TEXT(""), DirectorySearchOption::TopDirectoryOnly);
for (int32 i = files.Count() - 1; i >= 0; i--)
{
bool skip = false;

View File

@@ -368,6 +368,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
// Compile for a target platform
switch (data.Data.Platform)
{
#if PLATFORM_TOOLS_WINDOWS
case BuildPlatform::Windows32:
case BuildPlatform::Windows64:
{
@@ -391,6 +392,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
}
break;
}
#endif
#if PLATFORM_TOOLS_UWP
case BuildPlatform::UWPx86:
case BuildPlatform::UWPx64:
@@ -408,12 +410,14 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
break;
}
#endif
#if PLATFORM_TOOLS_UWP
case BuildPlatform::XboxOne:
{
const char* platformDefineName = "PLATFORM_XBOX_ONE";
COMPILE_PROFILE(DirectX_SM4, SHADER_FILE_CHUNK_INTERNAL_D3D_SM4_CACHE);
break;
}
#endif
#if PLATFORM_TOOLS_LINUX
case BuildPlatform::LinuxX64:
{
@@ -426,24 +430,30 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
break;
}
#endif
#if PLATFORM_TOOLS_PS4
case BuildPlatform::PS4:
{
const char* platformDefineName = "PLATFORM_PS4";
COMPILE_PROFILE(PS4, SHADER_FILE_CHUNK_INTERNAL_GENERIC_CACHE);
break;
}
#endif
#if PLATFORM_TOOLS_XBOX_SCARLETT
case BuildPlatform::XboxScarlett:
{
const char* platformDefineName = "PLATFORM_XBOX_SCARLETT";
COMPILE_PROFILE(DirectX_SM6, SHADER_FILE_CHUNK_INTERNAL_D3D_SM6_CACHE);
break;
}
#endif
#if PLATFORM_TOOLS_ANDROID
case BuildPlatform::AndroidARM64:
{
const char* platformDefineName = "PLATFORM_ANDROID";
COMPILE_PROFILE(Vulkan_SM5, SHADER_FILE_CHUNK_INTERNAL_VULKAN_SM5_CACHE);
break;
}
#endif
default:
{
LOG(Warning, "Not implemented platform or shaders not supported.");
@@ -895,21 +905,27 @@ bool CookAssetsStep::Perform(CookingData& data)
cache.Load(data);
// Update build settings
#if PLATFORM_TOOLS_WINDOWS
{
const auto settings = WindowsPlatformSettings::Get();
cache.Settings.Windows.SupportDX11 = settings->SupportDX11;
cache.Settings.Windows.SupportDX10 = settings->SupportDX10;
cache.Settings.Windows.SupportVulkan = settings->SupportVulkan;
}
#endif
#if PLATFORM_TOOLS_UWP
{
const auto settings = UWPPlatformSettings::Get();
cache.Settings.UWP.SupportDX11 = settings->SupportDX11;
cache.Settings.UWP.SupportDX10 = settings->SupportDX10;
}
#endif
#if PLATFORM_TOOLS_LINUX
{
const auto settings = LinuxPlatformSettings::Get();
cache.Settings.Linux.SupportVulkan = settings->SupportVulkan;
}
#endif
{
cache.Settings.Global.ShadersNoOptimize = buildSettings->ShadersNoOptimize;
cache.Settings.Global.ShadersGenerateDebugData = buildSettings->ShadersGenerateDebugData;