Add PS5 platform defines and types

This commit is contained in:
Wojtek Figat
2021-10-08 16:24:59 +02:00
parent aef024f572
commit 48a867ef16
56 changed files with 216 additions and 46 deletions

View File

@@ -40,6 +40,8 @@ namespace FlaxEditor.Content.Create
XboxScarlettPlatformSettings, XboxScarlettPlatformSettings,
AndroidPlatformSettings, AndroidPlatformSettings,
SwitchPlatformSettings, SwitchPlatformSettings,
[EditorDisplay(null, "PS5 Platform Settings")]
PS5PlatformSettings,
} }
private static readonly Type[] _types = private static readonly Type[] _types =
@@ -63,6 +65,7 @@ namespace FlaxEditor.Content.Create
TypeUtils.GetManagedType(GameSettings.XboxScarlettPlatformSettingsTypename), TypeUtils.GetManagedType(GameSettings.XboxScarlettPlatformSettingsTypename),
typeof(AndroidPlatformSettings), typeof(AndroidPlatformSettings),
TypeUtils.GetManagedType(GameSettings.SwitchPlatformSettingsTypename), TypeUtils.GetManagedType(GameSettings.SwitchPlatformSettingsTypename),
TypeUtils.GetManagedType(GameSettings.PS5PlatformSettingsTypename),
}; };
internal class Options internal class Options
@@ -228,6 +231,11 @@ namespace FlaxEditor.Content.Create
return false; return false;
instance.SwitchPlatform = asset; instance.SwitchPlatform = asset;
break; break;
case SettingsTypes.PS5PlatformSettings:
if (instance.PS5Platform != null)
return false;
instance.PS5Platform = asset;
break;
} }
return true; return true;
} }

View File

@@ -93,6 +93,12 @@ API_ENUM() enum class BuildPlatform
/// Switch. /// Switch.
/// </summary> /// </summary>
Switch = 10, Switch = 10,
/// <summary>
/// PlayStation 5
/// </summary>
API_ENUM(Attributes="EditorDisplay(null, \"PlayStation 5\")")
PS5 = 11,
}; };
extern FLAXENGINE_API const Char* ToString(const BuildPlatform platform); extern FLAXENGINE_API const Char* ToString(const BuildPlatform platform);

View File

@@ -42,6 +42,9 @@
#if PLATFORM_TOOLS_PS4 #if PLATFORM_TOOLS_PS4
#include "Platforms/PS4/Editor/PlatformTools/PS4PlatformTools.h" #include "Platforms/PS4/Editor/PlatformTools/PS4PlatformTools.h"
#endif #endif
#if PLATFORM_TOOLS_PS5
#include "Platforms/PS5/Editor/PlatformTools/PS5PlatformTools.h"
#endif
#if PLATFORM_TOOLS_XBOX_ONE #if PLATFORM_TOOLS_XBOX_ONE
#include "Platforms/XboxOne/Editor/PlatformTools/XboxOnePlatformTools.h" #include "Platforms/XboxOne/Editor/PlatformTools/XboxOnePlatformTools.h"
#endif #endif
@@ -123,6 +126,8 @@ const Char* ToString(const BuildPlatform platform)
return TEXT("Android ARM64"); return TEXT("Android ARM64");
case BuildPlatform::Switch: case BuildPlatform::Switch:
return TEXT("Switch"); return TEXT("Switch");
case BuildPlatform::PS5:
return TEXT("PlayStation 5");
default: default:
return TEXT("?"); return TEXT("?");
} }
@@ -314,6 +319,11 @@ PlatformTools* GameCooker::GetTools(BuildPlatform platform)
case BuildPlatform::Switch: case BuildPlatform::Switch:
result = New<SwitchPlatformTools>(); result = New<SwitchPlatformTools>();
break; break;
#endif
#if PLATFORM_TOOLS_PS5
case BuildPlatform::PS5:
result = New<PS5PlatformTools>();
break;
#endif #endif
} }
Tools.Add(platform, result); Tools.Add(platform, result);

View File

@@ -99,6 +99,7 @@ namespace FlaxEditor
case BuildPlatform.XboxOne: return PlatformType.XboxOne; case BuildPlatform.XboxOne: return PlatformType.XboxOne;
case BuildPlatform.LinuxX64: return PlatformType.Linux; case BuildPlatform.LinuxX64: return PlatformType.Linux;
case BuildPlatform.PS4: return PlatformType.PS4; case BuildPlatform.PS4: return PlatformType.PS4;
case BuildPlatform.PS5: return PlatformType.PS5;
case BuildPlatform.AndroidARM64: return PlatformType.Android; case BuildPlatform.AndroidARM64: return PlatformType.Android;
case BuildPlatform.XboxScarlett: return PlatformType.XboxScarlett; case BuildPlatform.XboxScarlett: return PlatformType.XboxScarlett;
case BuildPlatform.Switch: return PlatformType.Switch; case BuildPlatform.Switch: return PlatformType.Switch;

View File

@@ -182,6 +182,10 @@ bool CompileScriptsStep::Perform(CookingData& data)
platform = TEXT("Switch"); platform = TEXT("Switch");
architecture = TEXT("ARM64"); architecture = TEXT("ARM64");
break; break;
case BuildPlatform::PS5:
platform = TEXT("PS5");
architecture = TEXT("x64");
break;
default: default:
LOG(Error, "Unknown or unsupported build platform."); LOG(Error, "Unknown or unsupported build platform.");
return true; return true;

View File

@@ -514,6 +514,14 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
COMPILE_PROFILE(Vulkan_SM5, SHADER_FILE_CHUNK_INTERNAL_VULKAN_SM5_CACHE); COMPILE_PROFILE(Vulkan_SM5, SHADER_FILE_CHUNK_INTERNAL_VULKAN_SM5_CACHE);
break; break;
} }
#endif
#if PLATFORM_TOOLS_PS5
case BuildPlatform::PS5:
{
const char* platformDefineName = "PLATFORM_PS5";
COMPILE_PROFILE(PS5, SHADER_FILE_CHUNK_INTERNAL_GENERIC_CACHE);
break;
}
#endif #endif
default: default:
{ {

View File

@@ -57,6 +57,7 @@ public class Editor : EditorModule
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "UWP", "PLATFORM_TOOLS_UWP"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "UWP", "PLATFORM_TOOLS_UWP");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxOne", "PLATFORM_TOOLS_XBOX_ONE", "PLATFORM_TOOLS_GDK"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxOne", "PLATFORM_TOOLS_XBOX_ONE", "PLATFORM_TOOLS_GDK");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS4", "PLATFORM_TOOLS_PS4"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS4", "PLATFORM_TOOLS_PS4");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS5", "PLATFORM_TOOLS_PS5");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxScarlett", "PLATFORM_TOOLS_XBOX_SCARLETT", "PLATFORM_TOOLS_GDK"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxScarlett", "PLATFORM_TOOLS_XBOX_SCARLETT", "PLATFORM_TOOLS_GDK");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Android", "PLATFORM_TOOLS_ANDROID"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Android", "PLATFORM_TOOLS_ANDROID");
AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Switch", "PLATFORM_TOOLS_SWITCH"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Switch", "PLATFORM_TOOLS_SWITCH");

View File

@@ -90,6 +90,7 @@ namespace FlaxEditor.GUI
new PlatformData(PlatformType.XboxScarlett, icons.XBoxScarletIcon128, "Xbox Scarlett"), new PlatformData(PlatformType.XboxScarlett, icons.XBoxScarletIcon128, "Xbox Scarlett"),
new PlatformData(PlatformType.Android, icons.AndroidIcon128, "Android"), new PlatformData(PlatformType.Android, icons.AndroidIcon128, "Android"),
new PlatformData(PlatformType.Switch, icons.SwitchIcon128, "Switch"), new PlatformData(PlatformType.Switch, icons.SwitchIcon128, "Switch"),
new PlatformData(PlatformType.PS5, icons.PS4Icon128, "PlayStation 5"),
}; };
const float IconSize = 64.0f; const float IconSize = 64.0f;

View File

@@ -962,6 +962,10 @@ namespace FlaxEditor.Modules
if (typeSwitchPlatformSettings != null) if (typeSwitchPlatformSettings != null)
Proxy.Add(new SettingsProxy(typeSwitchPlatformSettings, Editor.Instance.Icons.SwitchSettings128)); Proxy.Add(new SettingsProxy(typeSwitchPlatformSettings, Editor.Instance.Icons.SwitchSettings128));
var typePS5PlatformSettings = TypeUtils.GetManagedType(GameSettings.PS5PlatformSettingsTypename);
if (typePS5PlatformSettings != null)
Proxy.Add(new SettingsProxy(typePS5PlatformSettings, Editor.Instance.Icons.PlaystationSettings128));
// Last add generic json (won't override other json proxies) // Last add generic json (won't override other json proxies)
Proxy.Add(new GenericJsonAssetProxy()); Proxy.Add(new GenericJsonAssetProxy());

View File

@@ -1346,9 +1346,9 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Platform Switch", Title = "Platform Switch",
Description = "Gets the input value based on the runtime-platform type", Description = "Gets the input value based on the runtime-platform type",
Flags = NodeFlags.AllGraphs, Flags = NodeFlags.AllGraphs,
Size = new Vector2(220, 180), Size = new Vector2(220, 200),
ConnectionsHints = ConnectionsHint.Value, ConnectionsHints = ConnectionsHint.Value,
IndependentBoxes = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, IndependentBoxes = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },
DependentBoxes = new[] { 0 }, DependentBoxes = new[] { 0 },
Elements = new[] Elements = new[]
{ {
@@ -1362,6 +1362,7 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Input(6, "Xbox Scarlett", true, null, 7), NodeElementArchetype.Factory.Input(6, "Xbox Scarlett", true, null, 7),
NodeElementArchetype.Factory.Input(7, "Android", true, null, 8), NodeElementArchetype.Factory.Input(7, "Android", true, null, 8),
NodeElementArchetype.Factory.Input(8, "Switch", true, null, 9), NodeElementArchetype.Factory.Input(8, "Switch", true, null, 9),
NodeElementArchetype.Factory.Input(9, "PlayStation 5", true, null, 10),
} }
}, },
new NodeArchetype new NodeArchetype

View File

@@ -44,6 +44,7 @@ namespace FlaxEditor.Windows
{ PlatformType.XboxScarlett, new XboxScarlett() }, { PlatformType.XboxScarlett, new XboxScarlett() },
{ PlatformType.Android, new Android() }, { PlatformType.Android, new Android() },
{ PlatformType.Switch, new Switch() }, { PlatformType.Switch, new Switch() },
{ PlatformType.PS5, new PS5() },
}; };
public BuildTabProxy(GameCookerWindow win, PlatformSelector platformSelector) public BuildTabProxy(GameCookerWindow win, PlatformSelector platformSelector)
@@ -59,6 +60,7 @@ namespace FlaxEditor.Windows
PerPlatformOptions[PlatformType.XboxScarlett].Init("Output/XboxScarlett", "XboxScarlett"); PerPlatformOptions[PlatformType.XboxScarlett].Init("Output/XboxScarlett", "XboxScarlett");
PerPlatformOptions[PlatformType.Android].Init("Output/Android", "Android"); PerPlatformOptions[PlatformType.Android].Init("Output/Android", "Android");
PerPlatformOptions[PlatformType.Switch].Init("Output/Switch", "Switch"); PerPlatformOptions[PlatformType.Switch].Init("Output/Switch", "Switch");
PerPlatformOptions[PlatformType.PS5].Init("Output/PS5", "PS5");
} }
abstract class Platform abstract class Platform
@@ -195,6 +197,11 @@ namespace FlaxEditor.Windows
protected override BuildPlatform BuildPlatform => BuildPlatform.Switch; protected override BuildPlatform BuildPlatform => BuildPlatform.Switch;
} }
class PS5 : Platform
{
protected override BuildPlatform BuildPlatform => BuildPlatform.PS5;
}
class Editor : CustomEditor class Editor : CustomEditor
{ {
private PlatformType _platform; private PlatformType _platform;
@@ -239,6 +246,9 @@ namespace FlaxEditor.Windows
case PlatformType.Switch: case PlatformType.Switch:
name = "Switch"; name = "Switch";
break; break;
case PlatformType.PS5:
name = "PlayStation 5";
break;
default: default:
name = CustomEditorsUtil.GetPropertyNameUI(_platform.ToString()); name = CustomEditorsUtil.GetPropertyNameUI(_platform.ToString());
break; break;

View File

@@ -50,6 +50,10 @@ public class Audio : EngineModule
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Audio")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Audio"));
options.CompileEnv.PreprocessorDefinitions.Add("AUDIO_API_SWITCH"); options.CompileEnv.PreprocessorDefinitions.Add("AUDIO_API_SWITCH");
break; break;
case TargetPlatform.PS5:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Audio"));
options.CompileEnv.PreprocessorDefinitions.Add("AUDIO_API_PS5");
break;
default: throw new InvalidPlatformException(options.Platform.Target); default: throw new InvalidPlatformException(options.Platform.Target);
} }

View File

@@ -18,6 +18,9 @@
#if AUDIO_API_PS4 #if AUDIO_API_PS4
#include "Platforms/PS4/Engine/Audio/AudioBackendPS4.h" #include "Platforms/PS4/Engine/Audio/AudioBackendPS4.h"
#endif #endif
#if AUDIO_API_PS5
#include "Platforms/PS5/Engine/Audio/AudioBackendPS5.h"
#endif
#if AUDIO_API_SWITCH #if AUDIO_API_SWITCH
#include "Platforms/Switch/Engine/Audio/AudioBackendSwitch.h" #include "Platforms/Switch/Engine/Audio/AudioBackendSwitch.h"
#endif #endif
@@ -182,44 +185,34 @@ bool AudioService::Init()
AudioBackend* backend = nullptr; AudioBackend* backend = nullptr;
#if AUDIO_API_NONE #if AUDIO_API_NONE
if (mute) if (mute)
{
backend = New<AudioBackendNone>(); backend = New<AudioBackendNone>();
}
#endif #endif
#if AUDIO_API_PS4 #if AUDIO_API_PS4
if (!backend) if (!backend)
{
backend = New<AudioBackendPS4>(); backend = New<AudioBackendPS4>();
} #endif
#if AUDIO_API_PS5
if (!backend)
backend = New<AudioBackendPS5>();
#endif #endif
#if AUDIO_API_SWITCH #if AUDIO_API_SWITCH
if (!backend) if (!backend)
{
backend = New<AudioBackendSwitch>(); backend = New<AudioBackendSwitch>();
}
#endif #endif
#if AUDIO_API_OPENAL #if AUDIO_API_OPENAL
if (!backend) if (!backend)
{
backend = New<AudioBackendOAL>(); backend = New<AudioBackendOAL>();
}
#endif #endif
#if AUDIO_API_XAUDIO2 #if AUDIO_API_XAUDIO2
if (!backend) if (!backend)
{
backend = New<AudioBackendXAudio2>(); backend = New<AudioBackendXAudio2>();
}
#endif #endif
#if AUDIO_API_NONE #if AUDIO_API_NONE
if (!backend) if (!backend)
{
backend = New<AudioBackendNone>(); backend = New<AudioBackendNone>();
}
#else #else
if (mute) if (mute)
{
LOG(Warning, "Cannot use mute audio. Null Audio Backend not available on this platform."); LOG(Warning, "Cannot use mute audio. Null Audio Backend not available on this platform.");
}
#endif #endif
if (backend == nullptr) if (backend == nullptr)
{ {

View File

@@ -55,6 +55,8 @@ IMPLEMENT_SETTINGS_GETTER(UWPPlatformSettings, UWPPlatform);
IMPLEMENT_SETTINGS_GETTER(LinuxPlatformSettings, LinuxPlatform); IMPLEMENT_SETTINGS_GETTER(LinuxPlatformSettings, LinuxPlatform);
#elif PLATFORM_PS4 #elif PLATFORM_PS4
IMPLEMENT_SETTINGS_GETTER(PS4PlatformSettings, PS4Platform); IMPLEMENT_SETTINGS_GETTER(PS4PlatformSettings, PS4Platform);
#elif PLATFORM_PS5
IMPLEMENT_SETTINGS_GETTER(PS5PlatformSettings, PS5Platform);
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
IMPLEMENT_SETTINGS_GETTER(XboxOnePlatformSettings, XboxOnePlatform); IMPLEMENT_SETTINGS_GETTER(XboxOnePlatformSettings, XboxOnePlatform);
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT
@@ -223,6 +225,7 @@ void GameSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* mo
DESERIALIZE(XboxScarlettPlatform); DESERIALIZE(XboxScarlettPlatform);
DESERIALIZE(AndroidPlatform); DESERIALIZE(AndroidPlatform);
DESERIALIZE(SwitchPlatform); DESERIALIZE(SwitchPlatform);
DESERIALIZE(PS5Platform);
} }
void LayersAndTagsSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) void LayersAndTagsSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

View File

@@ -10,6 +10,7 @@ namespace FlaxEditor.Content.Settings
partial class GameSettings partial class GameSettings
{ {
internal const string PS4PlatformSettingsTypename = "FlaxEditor.Content.Settings.PS4PlatformSettings"; internal const string PS4PlatformSettingsTypename = "FlaxEditor.Content.Settings.PS4PlatformSettings";
internal const string PS5PlatformSettingsTypename = "FlaxEditor.Content.Settings.PS5PlatformSettings";
internal const string XboxOnePlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxOnePlatformSettings"; internal const string XboxOnePlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxOnePlatformSettings";
internal const string XboxScarlettPlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxScarlettPlatformSettings"; internal const string XboxScarlettPlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxScarlettPlatformSettings";
internal const string SwitchPlatformSettingsTypename = "FlaxEditor.Content.Settings.SwitchPlatformSettings"; internal const string SwitchPlatformSettingsTypename = "FlaxEditor.Content.Settings.SwitchPlatformSettings";
@@ -168,6 +169,14 @@ namespace FlaxEditor.Content.Settings
public JsonAsset SwitchPlatform; public JsonAsset SwitchPlatform;
#endif #endif
#if FLAX_EDITOR || PLATFORM_PS5
/// <summary>
/// Reference to PS5 Platform Settings asset. Used to apply configuration on PS5 platform.
/// </summary>
[EditorOrder(2080), EditorDisplay("Platform Settings", "PlayStation 5"), AssetReference(PS5PlatformSettingsTypename, true), Tooltip("Reference to PS5 Platform Settings asset")]
public JsonAsset PS5Platform;
#endif
/// <summary> /// <summary>
/// Gets the absolute path to the game settings asset file. /// Gets the absolute path to the game settings asset file.
/// </summary> /// </summary>
@@ -282,6 +291,10 @@ namespace FlaxEditor.Content.Settings
if (type.FullName == SwitchPlatformSettingsTypename) if (type.FullName == SwitchPlatformSettingsTypename)
return LoadAsset(gameSettings.SwitchPlatform, SwitchPlatformSettingsTypename) as T; return LoadAsset(gameSettings.SwitchPlatform, SwitchPlatformSettingsTypename) as T;
#endif #endif
#if FLAX_EDITOR || PLATFORM_PS5
if (type.FullName == PS5PlatformSettingsTypename)
return LoadAsset(gameSettings.PS5Platform, PS5PlatformSettingsTypename) as T;
#endif
if (gameSettings.CustomSettings != null) if (gameSettings.CustomSettings != null)
{ {
@@ -374,6 +387,8 @@ namespace FlaxEditor.Content.Settings
return SaveAsset(gameSettings, ref gameSettings.AndroidPlatform, obj); return SaveAsset(gameSettings, ref gameSettings.AndroidPlatform, obj);
if (type.FullName == SwitchPlatformSettingsTypename) if (type.FullName == SwitchPlatformSettingsTypename)
return SaveAsset(gameSettings, ref gameSettings.SwitchPlatform, obj); return SaveAsset(gameSettings, ref gameSettings.SwitchPlatform, obj);
if (type.FullName == PS5PlatformSettingsTypename)
return SaveAsset(gameSettings, ref gameSettings.PS5Platform, obj);
if (type == typeof(AudioSettings)) if (type == typeof(AudioSettings))
return SaveAsset(gameSettings, ref gameSettings.Audio, obj); return SaveAsset(gameSettings, ref gameSettings.Audio, obj);

View File

@@ -81,6 +81,7 @@ public:
Guid XboxScarlettPlatform; Guid XboxScarlettPlatform;
Guid AndroidPlatform; Guid AndroidPlatform;
Guid SwitchPlatform; Guid SwitchPlatform;
Guid PS5Platform;
public: public:

View File

@@ -29,3 +29,6 @@
#if PLATFORM_SWITCH #if PLATFORM_SWITCH
#include "Platforms/Switch/Engine/Platform/SwitchPlatformSettings.h" #include "Platforms/Switch/Engine/Platform/SwitchPlatformSettings.h"
#endif #endif
#if PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5PlatformSettings.h"
#endif

View File

@@ -44,6 +44,9 @@ public class Engine : EngineModule
case TargetPlatform.PS4: case TargetPlatform.PS4:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Engine")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Engine"));
break; break;
case TargetPlatform.PS5:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Engine"));
break;
case TargetPlatform.Switch: case TargetPlatform.Switch:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Engine")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Engine"));
break; break;

View File

@@ -12,6 +12,8 @@
#include "Linux/LinuxGame.h" #include "Linux/LinuxGame.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Engine/PS4Game.h" #include "Platforms/PS4/Engine/Engine/PS4Game.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Engine/PS5Game.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Platforms/XboxOne/Engine/Engine/XboxOneGame.h" #include "Platforms/XboxOne/Engine/Engine/XboxOneGame.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -70,6 +70,11 @@ API_ENUM() enum class RendererType
/// </summary> /// </summary>
PS4 = 11, PS4 = 11,
/// <summary>
/// PlayStation 5
/// </summary>
PS5 = 12,
API_ENUM(Attributes="HideInEditor") API_ENUM(Attributes="HideInEditor")
MAX MAX
}; };
@@ -121,6 +126,11 @@ API_ENUM() enum class ShaderProfile
/// </summary> /// </summary>
DirectX_SM6 = 7, DirectX_SM6 = 7,
/// <summary>
/// PlayStation 5
/// </summary>
PS5 = 8,
API_ENUM(Attributes="HideInEditor") API_ENUM(Attributes="HideInEditor")
MAX MAX
}; };

View File

@@ -72,6 +72,9 @@ public class Graphics : EngineModule
case TargetPlatform.PS4: case TargetPlatform.PS4:
options.PrivateDependencies.Add("GraphicsDevicePS4"); options.PrivateDependencies.Add("GraphicsDevicePS4");
break; break;
case TargetPlatform.PS5:
options.PrivateDependencies.Add("GraphicsDevicePS5");
break;
case TargetPlatform.Android: case TargetPlatform.Android:
options.PrivateDependencies.Add("GraphicsDeviceVulkan"); options.PrivateDependencies.Add("GraphicsDeviceVulkan");
break; break;

View File

@@ -30,6 +30,9 @@ extern GPUDevice* CreateGPUDeviceDX12();
#if GRAPHICS_API_PS4 #if GRAPHICS_API_PS4
extern GPUDevice* CreateGPUDevicePS4(); extern GPUDevice* CreateGPUDevicePS4();
#endif #endif
#if GRAPHICS_API_PS5
extern GPUDevice* CreateGPUDevicePS5();
#endif
class GraphicsService : public EngineService class GraphicsService : public EngineService
{ {
@@ -132,6 +135,10 @@ bool GraphicsService::Init()
#if GRAPHICS_API_PS4 #if GRAPHICS_API_PS4
if (!device) if (!device)
device = CreateGPUDevicePS4(); device = CreateGPUDevicePS4();
#endif
#if GRAPHICS_API_PS5
if (!device)
device = CreateGPUDevicePS5();
#endif #endif
} }

View File

@@ -52,6 +52,9 @@ const Char* ToString(RendererType value)
case RendererType::PS4: case RendererType::PS4:
result = TEXT("PS4"); result = TEXT("PS4");
break; break;
case RendererType::PS5:
result = TEXT("PS5");
break;
default: default:
result = TEXT("?"); result = TEXT("?");
} }
@@ -87,6 +90,9 @@ const Char* ToString(ShaderProfile value)
case ShaderProfile::PS4: case ShaderProfile::PS4:
result = TEXT("PS4"); result = TEXT("PS4");
break; break;
case ShaderProfile::PS5:
result = TEXT("PS5");
break;
default: default:
result = TEXT("?"); result = TEXT("?");
} }
@@ -289,6 +295,7 @@ FeatureLevel RenderTools::GetFeatureLevel(ShaderProfile profile)
switch (profile) switch (profile)
{ {
case ShaderProfile::DirectX_SM6: case ShaderProfile::DirectX_SM6:
case ShaderProfile::PS5:
return FeatureLevel::SM6; return FeatureLevel::SM6;
case ShaderProfile::DirectX_SM5: case ShaderProfile::DirectX_SM5:
case ShaderProfile::Vulkan_SM5: case ShaderProfile::Vulkan_SM5:
@@ -313,6 +320,7 @@ bool RenderTools::CanSupportTessellation(ShaderProfile profile)
case ShaderProfile::DirectX_SM6: case ShaderProfile::DirectX_SM6:
case ShaderProfile::DirectX_SM5: case ShaderProfile::DirectX_SM5:
case ShaderProfile::PS4: case ShaderProfile::PS4:
case ShaderProfile::PS5:
return true; return true;
default: default:
return false; return false;

View File

@@ -11,7 +11,7 @@
#include "Engine/Graphics/Materials/MaterialShader.h" #include "Engine/Graphics/Materials/MaterialShader.h"
#include "Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h" #include "Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h"
const Char* ShaderProfileCacheDirNames[8] = const Char* ShaderProfileCacheDirNames[] =
{ {
// @formatter:off // @formatter:off
TEXT("EARTH_IS_NOT_FLAT_XD"), // Unknown TEXT("EARTH_IS_NOT_FLAT_XD"), // Unknown
@@ -22,6 +22,7 @@ const Char* ShaderProfileCacheDirNames[8] =
TEXT("VK_SM5"), // Vulkan_SM5 TEXT("VK_SM5"), // Vulkan_SM5
TEXT("PS4"), // PS4 TEXT("PS4"), // PS4
TEXT("DX_SM6"), // DirectX_SM6 TEXT("DX_SM6"), // DirectX_SM6
TEXT("PS5"), // PS5
// @formatter:on // @formatter:on
}; };

View File

@@ -57,6 +57,9 @@ public class Main : EngineModule
case TargetPlatform.PS4: case TargetPlatform.PS4:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Main")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Main"));
break; break;
case TargetPlatform.PS5:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Main"));
break;
case TargetPlatform.XboxOne: case TargetPlatform.XboxOne:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Main")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Main"));
break; break;

View File

@@ -587,6 +587,8 @@ const Char* ToString(PlatformType type)
return TEXT("Android"); return TEXT("Android");
case PlatformType::Switch: case PlatformType::Switch:
return TEXT("Switch"); return TEXT("Switch");
case PlatformType::PS5:
return TEXT("PlayStation 5");
default: default:
return TEXT(""); return TEXT("");
} }

View File

@@ -4,22 +4,10 @@
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
#include "Windows/WindowsClipboard.h" #include "Windows/WindowsClipboard.h"
#elif PLATFORM_UWP
#include "Base/ClipboardBase.h"
#elif PLATFORM_LINUX #elif PLATFORM_LINUX
#include "Linux/LinuxClipboard.h" #include "Linux/LinuxClipboard.h"
#elif PLATFORM_PS4
#include "Base/ClipboardBase.h"
#elif PLATFORM_XBOX_ONE
#include "Base/ClipboardBase.h"
#elif PLATFORM_XBOX_SCARLETT
#include "Base/ClipboardBase.h"
#elif PLATFORM_ANDROID
#include "Base/ClipboardBase.h"
#elif PLATFORM_SWITCH
#include "Base/ClipboardBase.h"
#else #else
#error Missing Clipboard implementation! #include "Base/ClipboardBase.h"
#endif #endif
#include "Types.h" #include "Types.h"

View File

@@ -10,6 +10,8 @@
#include "Unix/UnixCriticalSection.h" #include "Unix/UnixCriticalSection.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Unix/UnixCriticalSection.h" #include "Unix/UnixCriticalSection.h"
#elif PLATFORM_PS5
#include "Unix/UnixCriticalSection.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Win32/Win32CriticalSection.h" #include "Win32/Win32CriticalSection.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -48,6 +48,11 @@ API_ENUM() enum class PlatformType
/// Running on Switch. /// Running on Switch.
/// </summary> /// </summary>
Switch = 8, Switch = 8,
/// <summary>
/// Running on PlayStation 5.
/// </summary>
PS5 = 9,
}; };
/// <summary> /// <summary>
@@ -103,6 +108,9 @@ API_ENUM() enum class ArchitectureType
#if !defined(PLATFORM_PS4) #if !defined(PLATFORM_PS4)
#define PLATFORM_PS4 0 #define PLATFORM_PS4 0
#endif #endif
#if !defined(PLATFORM_PS5)
#define PLATFORM_PS5 0
#endif
#if !defined(PLATFORM_XBOX_SCARLETT) #if !defined(PLATFORM_XBOX_SCARLETT)
#define PLATFORM_XBOX_SCARLETT 0 #define PLATFORM_XBOX_SCARLETT 0
#endif #endif
@@ -130,6 +138,8 @@ API_ENUM() enum class ArchitectureType
#include "Linux/LinuxDefines.h" #include "Linux/LinuxDefines.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Platform/PS4Defines.h" #include "Platforms/PS4/Engine/Platform/PS4Defines.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5Defines.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Platforms/XboxOne/Engine/Platform/XboxOneDefines.h" #include "Platforms/XboxOne/Engine/Platform/XboxOneDefines.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT
@@ -178,7 +188,7 @@ API_ENUM() enum class ArchitectureType
// Platform family defines // Platform family defines
#define PLATFORM_WINDOWS_FAMILY (PLATFORM_WINDOWS || PLATFORM_UWP || PLATFORM_XBOX_ONE || PLATFORM_XBOX_SCARLETT) #define PLATFORM_WINDOWS_FAMILY (PLATFORM_WINDOWS || PLATFORM_UWP || PLATFORM_XBOX_ONE || PLATFORM_XBOX_SCARLETT)
#define PLATFORM_MICROSOFT_FAMILY (PLATFORM_WINDOWS_FAMILY) #define PLATFORM_MICROSOFT_FAMILY (PLATFORM_WINDOWS_FAMILY)
#define PLATFORM_UNIX_FAMILY (PLATFORM_LINUX || PLATFORM_ANDROID || PLATFORM_PS4) #define PLATFORM_UNIX_FAMILY (PLATFORM_LINUX || PLATFORM_ANDROID || PLATFORM_PS4 || PLATFORM_PS5)
#define PLATFORM_APPLE_FAMILY (PLATFORM_IOS || PLATFORM_OSX) #define PLATFORM_APPLE_FAMILY (PLATFORM_IOS || PLATFORM_OSX)
// SIMD defines // SIMD defines

View File

@@ -10,6 +10,8 @@
#include "Unix/UnixFile.h" #include "Unix/UnixFile.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Unix/UnixFile.h" #include "Unix/UnixFile.h"
#elif PLATFORM_PS5
#include "Unix/UnixFile.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Win32/Win32File.h" #include "Win32/Win32File.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -10,6 +10,8 @@
#include "Linux/LinuxFileSystem.h" #include "Linux/LinuxFileSystem.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Platform/PS4FileSystem.h" #include "Platforms/PS4/Engine/Platform/PS4FileSystem.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5FileSystem.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Platforms/XboxOne/Engine/Platform/XboxOneFileSystem.h" #include "Platforms/XboxOne/Engine/Platform/XboxOneFileSystem.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -4,20 +4,10 @@
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
#include "Windows/WindowsFileSystemWatcher.h" #include "Windows/WindowsFileSystemWatcher.h"
#elif PLATFORM_UWP
#include "Base/FileSystemWatcherBase.h"
#elif PLATFORM_LINUX #elif PLATFORM_LINUX
#include "Linux/LinuxFileSystemWatcher.h" #include "Linux/LinuxFileSystemWatcher.h"
#elif PLATFORM_PS4
#include "Base/FileSystemWatcherBase.h"
#elif PLATFORM_XBOX_SCARLETT
#include "Base/FileSystemWatcherBase.h"
#elif PLATFORM_ANDROID
#include "Base/FileSystemWatcherBase.h"
#elif PLATFORM_SWITCH
#include "Base/FileSystemWatcherBase.h"
#else #else
#error Missing File System Watcher implementation! #include "Base/FileSystemWatcherBase.h"
#endif #endif
#include "Types.h" #include "Types.h"

View File

@@ -10,6 +10,8 @@
#include "Unix/UnixNetwork.h" #include "Unix/UnixNetwork.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Platform/PS4Network.h" #include "Platforms/PS4/Engine/Platform/PS4Network.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5Network.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Win32/Win32Network.h" #include "Win32/Win32Network.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -56,6 +56,10 @@ public class Platform : EngineModule
options.SourcePaths.Add(Path.Combine(FolderPath, "Unix")); options.SourcePaths.Add(Path.Combine(FolderPath, "Unix"));
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform"));
break; break;
case TargetPlatform.PS5:
options.SourcePaths.Add(Path.Combine(FolderPath, "Unix"));
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Platform"));
break;
case TargetPlatform.XboxOne: case TargetPlatform.XboxOne:
options.SourcePaths.Add(Path.Combine(FolderPath, "Win32")); options.SourcePaths.Add(Path.Combine(FolderPath, "Win32"));
options.SourcePaths.Add(Path.Combine(FolderPath, "GDK")); options.SourcePaths.Add(Path.Combine(FolderPath, "GDK"));
@@ -86,6 +90,7 @@ public class Platform : EngineModule
AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Platform", "XboxOnePlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Platform", "XboxOnePlatformSettings.h"));
AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxScarlett", "Engine", "Platform", "XboxScarlettPlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxScarlett", "Engine", "Platform", "XboxScarlettPlatformSettings.h"));
AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform", "PS4PlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform", "PS4PlatformSettings.h"));
AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Platform", "PS5PlatformSettings.h"));
AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Platform", "SwitchPlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Platform", "SwitchPlatformSettings.h"));
} }
} }

View File

@@ -16,6 +16,8 @@
#include "Linux/LinuxPlatform.h" #include "Linux/LinuxPlatform.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Platform/PS4Platform.h" #include "Platforms/PS4/Engine/Platform/PS4Platform.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5Platform.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Platforms/XboxOne/Engine/Platform/XboxOnePlatform.h" #include "Platforms/XboxOne/Engine/Platform/XboxOnePlatform.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -10,6 +10,8 @@
#include "Linux/LinuxThread.h" #include "Linux/LinuxThread.h"
#elif PLATFORM_PS4 #elif PLATFORM_PS4
#include "Platforms/PS4/Engine/Platform/PS4Thread.h" #include "Platforms/PS4/Engine/Platform/PS4Thread.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5Thread.h"
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
#include "Win32/Win32Thread.h" #include "Win32/Win32Thread.h"
#elif PLATFORM_XBOX_SCARLETT #elif PLATFORM_XBOX_SCARLETT

View File

@@ -93,6 +93,30 @@ class PS4Window;
typedef PS4Window Window; typedef PS4Window Window;
class PS4Network; class PS4Network;
typedef PS4Network Network; typedef PS4Network Network;
#elif PLATFORM_PS5
class ClipboardBase;
typedef ClipboardBase Clipboard;
class UnixCriticalSection;
typedef UnixCriticalSection CriticalSection;
class UnixConditionVariable;
typedef UnixConditionVariable ConditionVariable;
class PS5FileSystem;
typedef PS5FileSystem FileSystem;
class FileSystemWatcherBase;
typedef FileSystemWatcherBase FileSystemWatcher;
class UnixFile;
typedef UnixFile File;
class PS5Platform;
typedef PS5Platform Platform;
class PS5Thread;
typedef PS5Thread Thread;
class PS5Window;
typedef PS5Window Window;
class PS5Network;
typedef PS5Network Network;
#elif PLATFORM_XBOX_ONE #elif PLATFORM_XBOX_ONE
class ClipboardBase; class ClipboardBase;

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if PLATFORM_UNIX && !PLATFORM_PS4 #if PLATFORM_UNIX && !PLATFORM_PS4 && !PLATFORM_PS5
#include "UnixNetwork.h" #include "UnixNetwork.h"
#include "Engine/Core/Log.h" #include "Engine/Core/Log.h"

View File

@@ -58,6 +58,8 @@ public class ShadersCompilation : EngineModule
if (Sdk.HasValid("PS4Sdk")) if (Sdk.HasValid("PS4Sdk"))
options.PrivateDependencies.Add("ShaderCompilerPS4"); options.PrivateDependencies.Add("ShaderCompilerPS4");
if (Sdk.HasValid("PS5Sdk"))
options.PrivateDependencies.Add("ShaderCompilerPS5");
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@@ -37,6 +37,9 @@
#if COMPILE_WITH_PS4_SHADER_COMPILER #if COMPILE_WITH_PS4_SHADER_COMPILER
#include "Platforms/PS4/Engine/ShaderCompilerPS4/ShaderCompilerPS4.h" #include "Platforms/PS4/Engine/ShaderCompilerPS4/ShaderCompilerPS4.h"
#endif #endif
#if COMPILE_WITH_PS5_SHADER_COMPILER
#include "Platforms/PS5/Engine/ShaderCompilerPS5/ShaderCompilerPS5.h"
#endif
namespace ShadersCompilationImpl namespace ShadersCompilationImpl
{ {
@@ -151,7 +154,6 @@ ShaderCompiler* ShadersCompilation::CreateCompiler(ShaderProfile profile)
switch (profile) switch (profile)
{ {
#if COMPILE_WITH_D3D_SHADER_COMPILER #if COMPILE_WITH_D3D_SHADER_COMPILER
// Direct 3D
case ShaderProfile::DirectX_SM4: case ShaderProfile::DirectX_SM4:
case ShaderProfile::DirectX_SM5: case ShaderProfile::DirectX_SM5:
result = New<ShaderCompilerD3D>(profile); result = New<ShaderCompilerD3D>(profile);
@@ -163,16 +165,19 @@ ShaderCompiler* ShadersCompilation::CreateCompiler(ShaderProfile profile)
break; break;
#endif #endif
#if COMPILE_WITH_VK_SHADER_COMPILER #if COMPILE_WITH_VK_SHADER_COMPILER
// Vulkan
case ShaderProfile::Vulkan_SM5: case ShaderProfile::Vulkan_SM5:
result = New<ShaderCompilerVulkan>(profile); result = New<ShaderCompilerVulkan>(profile);
break; break;
#endif #endif
#if COMPILE_WITH_PS4_SHADER_COMPILER #if COMPILE_WITH_PS4_SHADER_COMPILER
// PS4
case ShaderProfile::PS4: case ShaderProfile::PS4:
result = New<ShaderCompilerPS4>(); result = New<ShaderCompilerPS4>();
break; break;
#endif
#if COMPILE_WITH_PS5_SHADER_COMPILER
case ShaderProfile::PS5:
result = New<ShaderCompilerPS5>();
break;
#endif #endif
default: default:
break; break;

View File

@@ -32,6 +32,7 @@ public class TextureTool : EngineModule
break; break;
case TargetPlatform.Linux: case TargetPlatform.Linux:
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
case TargetPlatform.Android: case TargetPlatform.Android:
case TargetPlatform.Switch: case TargetPlatform.Switch:
useStb = true; useStb = true;

View File

@@ -768,6 +768,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
PLATFORM_CASE(7, "PLATFORM_XBOX_SCARLETT"); PLATFORM_CASE(7, "PLATFORM_XBOX_SCARLETT");
PLATFORM_CASE(8, "PLATFORM_ANDROID"); PLATFORM_CASE(8, "PLATFORM_ANDROID");
PLATFORM_CASE(9, "PLATFORM_SWITCH"); PLATFORM_CASE(9, "PLATFORM_SWITCH");
PLATFORM_CASE(10, "PLATFORM_PS5");
#undef PLATFORM_CASE #undef PLATFORM_CASE
break; break;
} }

View File

@@ -891,6 +891,9 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
case PlatformType::Switch: case PlatformType::Switch:
boxId = 9; boxId = 9;
break; break;
case PlatformType::PS5:
boxId = 10;
break;
default: ; default: ;
} }
value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero); value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero);

View File

@@ -39,6 +39,7 @@ public class freetype : DepsModule
break; break;
case TargetPlatform.Linux: case TargetPlatform.Linux:
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
case TargetPlatform.Android: case TargetPlatform.Android:
case TargetPlatform.Switch: case TargetPlatform.Switch:
options.OutputFiles.Add(Path.Combine(depsRoot, "libfreetype.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libfreetype.a"));

View File

@@ -76,6 +76,7 @@ public class mono : DepsModule
options.Libraries.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so")); options.Libraries.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so"));
break; break;
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
options.OutputFiles.Add(Path.Combine(depsRoot, "libmono.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libmono.a"));
options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoruntime.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoruntime.a"));
options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoutils.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoutils.a"));

View File

@@ -38,6 +38,7 @@ public class ogg : DepsModule
break; break;
case TargetPlatform.Linux: case TargetPlatform.Linux:
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
case TargetPlatform.Android: case TargetPlatform.Android:
case TargetPlatform.Switch: case TargetPlatform.Switch:
options.OutputFiles.Add(Path.Combine(depsRoot, "libogg.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libogg.a"));

View File

@@ -46,6 +46,7 @@ public class vorbis : DepsModule
options.OutputFiles.Add(Path.Combine(depsRoot, "libvorbisfile.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libvorbisfile.a"));
break; break;
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
options.OutputFiles.Add(Path.Combine(depsRoot, "libvorbis.a")); options.OutputFiles.Add(Path.Combine(depsRoot, "libvorbis.a"));
break; break;
default: throw new InvalidPlatformException(options.Platform.Target); default: throw new InvalidPlatformException(options.Platform.Target);

View File

@@ -30,6 +30,7 @@ namespace Flax.Build
break; break;
case TargetPlatform.Linux: case TargetPlatform.Linux:
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
case TargetPlatform.Android: case TargetPlatform.Android:
case TargetPlatform.Switch: case TargetPlatform.Switch:
options.OutputFiles.Add(Path.Combine(path, string.Format("lib{0}.a", name))); options.OutputFiles.Add(Path.Combine(path, string.Format("lib{0}.a", name)));

View File

@@ -93,6 +93,7 @@ namespace Flax.Build
case TargetPlatform.UWP: return "PLATFORM_UWP"; case TargetPlatform.UWP: return "PLATFORM_UWP";
case TargetPlatform.Linux: return "PLATFORM_LINUX"; case TargetPlatform.Linux: return "PLATFORM_LINUX";
case TargetPlatform.PS4: return "PLATFORM_PS4"; case TargetPlatform.PS4: return "PLATFORM_PS4";
case TargetPlatform.PS5: return "PLATFORM_PS5";
case TargetPlatform.XboxScarlett: return "PLATFORM_XBOX_SCARLETT"; case TargetPlatform.XboxScarlett: return "PLATFORM_XBOX_SCARLETT";
case TargetPlatform.Android: return "PLATFORM_ANDROID"; case TargetPlatform.Android: return "PLATFORM_ANDROID";
case TargetPlatform.Switch: return "PLATFORM_SWITCH"; case TargetPlatform.Switch: return "PLATFORM_SWITCH";

View File

@@ -239,6 +239,7 @@ namespace Flax.Build
case TargetPlatform.UWP: return targetArchitecture == TargetArchitecture.x64; case TargetPlatform.UWP: return targetArchitecture == TargetArchitecture.x64;
case TargetPlatform.Linux: return targetArchitecture == TargetArchitecture.x64; case TargetPlatform.Linux: return targetArchitecture == TargetArchitecture.x64;
case TargetPlatform.PS4: return targetArchitecture == TargetArchitecture.x64; case TargetPlatform.PS4: return targetArchitecture == TargetArchitecture.x64;
case TargetPlatform.PS5: return targetArchitecture == TargetArchitecture.x64;
case TargetPlatform.Android: return targetArchitecture == TargetArchitecture.ARM64; case TargetPlatform.Android: return targetArchitecture == TargetArchitecture.ARM64;
case TargetPlatform.Switch: return targetArchitecture == TargetArchitecture.ARM64; case TargetPlatform.Switch: return targetArchitecture == TargetArchitecture.ARM64;
default: return false; default: return false;

View File

@@ -46,6 +46,11 @@ namespace Flax.Build
/// Running on Switch. /// Running on Switch.
/// </summary> /// </summary>
Switch = 8, Switch = 8,
/// <summary>
/// Running on PlayStation 5.
/// </summary>
PS5 = 9,
} }
/// <summary> /// <summary>

View File

@@ -238,6 +238,7 @@ namespace Flax.Deps
} }
case TargetPlatform.Linux: case TargetPlatform.Linux:
case TargetPlatform.PS4: case TargetPlatform.PS4:
case TargetPlatform.PS5:
{ {
cmdLine = "CMakeLists.txt"; cmdLine = "CMakeLists.txt";
break; break;

View File

@@ -138,6 +138,7 @@
<Compile Include="Platforms\Android\*.cs" /> <Compile Include="Platforms\Android\*.cs" />
<Compile Include="Platforms\Linux\*.cs" /> <Compile Include="Platforms\Linux\*.cs" />
<Compile Include="..\..\Platforms\PS4\Flax.Build\*.cs" /> <Compile Include="..\..\Platforms\PS4\Flax.Build\*.cs" />
<Compile Include="..\..\Platforms\PS5\Flax.Build\*.cs" />
<Compile Include="Platforms\Unix\*.cs" /> <Compile Include="Platforms\Unix\*.cs" />
<Compile Include="Platforms\UWP\*.cs" /> <Compile Include="Platforms\UWP\*.cs" />
<Compile Include="Platforms\Windows\*.cs" /> <Compile Include="Platforms\Windows\*.cs" />

View File

@@ -32,6 +32,7 @@ namespace Flax.Build
TargetPlatform.XboxOne, TargetPlatform.XboxOne,
TargetPlatform.Linux, TargetPlatform.Linux,
TargetPlatform.PS4, TargetPlatform.PS4,
TargetPlatform.PS5,
TargetPlatform.XboxScarlett, TargetPlatform.XboxScarlett,
TargetPlatform.Android, TargetPlatform.Android,
TargetPlatform.Switch, TargetPlatform.Switch,

View File

@@ -182,6 +182,7 @@ namespace Flax.Build.Platforms
default: throw new InvalidArchitectureException(architecture); default: throw new InvalidArchitectureException(architecture);
} }
case TargetPlatform.PS4: return (string)Utilities.GetStaticValue("Flax.Build.Platforms.PS4Toolchain", "ToolchainName"); case TargetPlatform.PS4: return (string)Utilities.GetStaticValue("Flax.Build.Platforms.PS4Toolchain", "ToolchainName");
case TargetPlatform.PS5: return (string)Utilities.GetStaticValue("Flax.Build.Platforms.PS5Toolchain", "ToolchainName");
case TargetPlatform.Android: case TargetPlatform.Android:
switch (architecture) switch (architecture)
{ {

View File

@@ -58,6 +58,7 @@ namespace Flax.Build.Platforms
case TargetPlatform.Windows: return GetSDKs().Count != 0; case TargetPlatform.Windows: return GetSDKs().Count != 0;
case TargetPlatform.UWP: return GetSDKs().FirstOrDefault(x => x.Key != WindowsPlatformSDK.v8_1).Value != null; case TargetPlatform.UWP: return GetSDKs().FirstOrDefault(x => x.Key != WindowsPlatformSDK.v8_1).Value != null;
case TargetPlatform.PS4: return Sdk.HasValid("PS4Sdk"); case TargetPlatform.PS4: return Sdk.HasValid("PS4Sdk");
case TargetPlatform.PS5: return Sdk.HasValid("PS5Sdk");
case TargetPlatform.XboxOne: case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett: return GetSDKs().ContainsKey(WindowsPlatformSDK.v10_0_19041_0) && Sdk.HasValid("GDK"); case TargetPlatform.XboxScarlett: return GetSDKs().ContainsKey(WindowsPlatformSDK.v10_0_19041_0) && Sdk.HasValid("GDK");
case TargetPlatform.Android: return AndroidSdk.Instance.IsValid && AndroidNdk.Instance.IsValid; case TargetPlatform.Android: return AndroidSdk.Instance.IsValid && AndroidNdk.Instance.IsValid;