PS5 support progress

This commit is contained in:
Wojtek Figat
2021-10-20 15:34:52 +02:00
parent f91be91693
commit 5dbbfed654
12 changed files with 90 additions and 18 deletions

View File

@@ -431,6 +431,9 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(BlendingMode);
/// </summary>
API_ENUM() enum class ColorWrite
{
// No color writing.
None = 0,
// Allow data to be stored in the red component.
Red = 1,
// Allow data to be stored in the green component.

View File

@@ -58,8 +58,8 @@ public class Graphics : EngineModule
case TargetPlatform.UWP:
options.PrivateDependencies.Add("GraphicsDeviceDX11");
break;
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
options.PrivateDependencies.Add("GraphicsDeviceDX12");
break;
case TargetPlatform.Linux:

View File

@@ -2,19 +2,9 @@
#pragma once
#if PLATFORM_WINDOWS
#if PLATFORM_WINDOWS || PLATFORM_UWP || PLATFORM_XBOX_ONE || PLATFORM_XBOX_SCARLETT
#include "Win32/Win32ConditionVariable.h"
#elif PLATFORM_UWP
#include "Win32/Win32ConditionVariable.h"
#elif PLATFORM_LINUX
#include "Unix/UnixConditionVariable.h"
#elif PLATFORM_PS4
#include "Unix/UnixConditionVariable.h"
#elif PLATFORM_XBOX_ONE
#include "Win32/Win32ConditionVariable.h"
#elif PLATFORM_XBOX_SCARLETT
#include "Win32/Win32ConditionVariable.h"
#elif PLATFORM_ANDROID
#elif PLATFORM_LINUX || PLATFORM_ANDROID || PLATFORM_PS4 || PLATFORM_PS5
#include "Unix/UnixConditionVariable.h"
#elif PLATFORM_SWITCH
#include "Platforms/Switch/Engine/Platform/SwitchConditionVariable.h"

View File

@@ -18,6 +18,8 @@
#include "Android/AndroidWindow.h"
#elif PLATFORM_SWITCH
#include "Platforms/Switch/Engine/Platform/SwitchWindow.h"
#elif PLATFORM_PS5
#include "Platforms/PS5/Engine/Platform/PS5Window.h"
#else
#error Missing Window implementation!
#endif

View File

@@ -102,6 +102,9 @@ Operating system defines, see http://sourceforge.net/p/predef/wiki/OperatingSyst
#define PX_IOS 1
#elif defined(__APPLE__)
#define PX_OSX 1
#elif defined(__PROSPERO__)
#define PX_PS4 1
#define PX_PS5 1
#elif defined(__ORBIS__)
#define PX_PS4 1
#elif defined(__NX__)

View File

@@ -140,7 +140,7 @@
#else
#include <sys/types.h>
#include <sys/socket.h>
#if PLATFORM_PS4
#if PLATFORM_PS4 || PLATFORM_PS5
#define ENET_IPV6 0
#include <netinet/in.h>
in_addr in4addr_any = { 0 };

View File

@@ -1291,7 +1291,7 @@ namespace Flax.Build.Bindings
var baseType = classInfo?.BaseType ?? structureInfo?.BaseType;
if (classInfo != null && classInfo.IsBaseTypeHidden)
baseType = null;
if (baseType != null && (baseType.Name == "PersistentScriptingObject" || baseType.Name == "ScriptingObject"))
if (baseType != null && (baseType.Name == "PersistentScriptingObject" || baseType.Name == "ScriptingObject" || baseType.Name == "ManagedScriptingObject"))
baseType = null;
CppAutoSerializeFields.Clear();
CppAutoSerializeProperties.Clear();

View File

@@ -31,6 +31,7 @@ namespace Flax.Deps.Dependencies
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
TargetPlatform.XboxScarlett,
TargetPlatform.Android,
TargetPlatform.Switch,
@@ -152,6 +153,12 @@ namespace Flax.Deps.Dependencies
suppressBitsPostfix = true;
binariesPrefix = "lib";
break;
case TargetPlatform.PS5:
binariesSubDir = "ps5";
buildPlatform = "PROSPERO";
suppressBitsPostfix = true;
binariesPrefix = "lib";
break;
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
binariesSubDir = "win.x86_64.vc142.md";
@@ -209,8 +216,9 @@ namespace Flax.Deps.Dependencies
switch (targetPlatform)
{
case TargetPlatform.PS4:
case TargetPlatform.PS5:
// Hack: PS4 uses .o extension for compiler output files but CMake uses .obj even if CMAKE_CXX_OUTPUT_EXTENSION/CMAKE_C_OUTPUT_EXTENSION are specified
Utilities.ReplaceInFiles(Path.Combine(root, "physx\\compiler\\ps4"), "*.vcxproj", SearchOption.AllDirectories, ".obj", ".o");
Utilities.ReplaceInFiles(Path.Combine(root, "physx\\compiler\\" + binariesSubDir), "*.vcxproj", SearchOption.AllDirectories, ".obj", ".o");
break;
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
@@ -320,7 +328,7 @@ namespace Flax.Deps.Dependencies
}
// Get the source
CloneGitRepoSingleBranch(root, "https://github.com/NVIDIAGameWorks/PhysX.git", "4.1");
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/PhysX.git", "flax-master");
foreach (var platform in options.Platforms)
{
@@ -347,6 +355,12 @@ namespace Flax.Deps.Dependencies
Build(options, "ps4", platform, TargetArchitecture.x64);
break;
}
case TargetPlatform.PS5:
{
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
Build(options, "ps5", platform, TargetArchitecture.x64);
break;
}
case TargetPlatform.XboxScarlett:
{
Build(options, "vc16win64", platform, TargetArchitecture.x64);

View File

@@ -29,6 +29,7 @@ namespace Flax.Deps.Dependencies
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
TargetPlatform.XboxScarlett,
TargetPlatform.Android,
TargetPlatform.Switch,
@@ -163,6 +164,21 @@ namespace Flax.Deps.Dependencies
break;
}
case TargetPlatform.PS5:
{
// Get the build data files
Utilities.DirectoryCopy(
Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"),
Path.Combine(root, "builds", "PS5"), false, true);
// Build for PS5
var solutionPath = Path.Combine(root, "builds", "PS5", "freetype.sln");
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "PROSPERO");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "lib", "PS5", libraryFileName), Path.Combine(depsFolder, libraryFileName));
break;
}
case TargetPlatform.XboxOne:
{
// Fix the MSVC project settings for Xbox One

View File

@@ -28,6 +28,7 @@ namespace Flax.Deps.Dependencies
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
TargetPlatform.XboxScarlett,
TargetPlatform.Android,
TargetPlatform.Switch,
@@ -143,6 +144,21 @@ namespace Flax.Deps.Dependencies
break;
}
case TargetPlatform.PS5:
{
// Get the build data files
Utilities.DirectoryCopy(
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg"),
Path.Combine(root, "PS5"), true, true);
// Build for PS5
var solutionPath = Path.Combine(root, "PS5", "libogg_static.sln");
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "PROSPERO");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "PS5", "lib", libraryFileName), Path.Combine(depsFolder, libraryFileName));
break;
}
case TargetPlatform.XboxOne:
{
// Fix the MSVC project settings for Xbox Scarlett

View File

@@ -29,6 +29,7 @@ namespace Flax.Deps.Dependencies
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
TargetPlatform.XboxScarlett,
TargetPlatform.Android,
TargetPlatform.Switch,
@@ -186,6 +187,24 @@ namespace Flax.Deps.Dependencies
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
break;
case TargetPlatform.PS5:
buildDir = Path.Combine(rootMsvcLib, "PS5");
binariesToCopy = new[]
{
new Binary("libvorbis.a", "libvorbis"),
};
vcxprojPaths = new[]
{
Path.Combine(buildDir, "libvorbis", "libvorbis_static.vcxproj"),
};
buildPlatform = "PROSPERO";
Utilities.DirectoryCopy(
Path.Combine(GetBinariesFolder(options, platform), "Data", "vorbis"),
buildDir, true, true);
Utilities.FileCopy(
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
break;
case TargetPlatform.XboxOne:
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
binariesToCopy = binariesToCopyWindows;
@@ -279,6 +298,11 @@ namespace Flax.Deps.Dependencies
BuildMsbuild(options, TargetPlatform.PS4, TargetArchitecture.x64);
break;
}
case TargetPlatform.PS5:
{
BuildMsbuild(options, TargetPlatform.PS5, TargetArchitecture.x64);
break;
}
case TargetPlatform.XboxScarlett:
{
BuildMsbuild(options, TargetPlatform.XboxScarlett, TargetArchitecture.x64);

View File

@@ -96,8 +96,12 @@ namespace Flax.Build.Platforms
var exeExtension = Platform.BuildPlatform.ExecutableFileExtension;
ToolsetRoot = toolchainSubDir == null ? Path.Combine(toolchainRoots, ArchitectureName) : Path.Combine(toolchainRoots, toolchainSubDir);
ClangPath = Path.Combine(Path.Combine(ToolsetRoot, string.Format("bin/{0}-{1}", ArchitectureName, "clang++"))) + exeExtension;
if (!File.Exists(ClangPath))
ClangPath = Path.Combine(Path.Combine(ToolsetRoot, string.Format("bin/{0}-{1}", ArchitectureName, "clang"))) + exeExtension;
if (!File.Exists(ClangPath))
ClangPath = Path.Combine(ToolsetRoot, "bin/clang++") + exeExtension;
if (!File.Exists(ClangPath))
ClangPath = Path.Combine(ToolsetRoot, "bin/clang") + exeExtension;
ArPath = Path.Combine(Path.Combine(ToolsetRoot, string.Format("bin/{0}-{1}", ArchitectureName, "ar"))) + exeExtension;
LlvmArPath = Path.Combine(Path.Combine(ToolsetRoot, string.Format("bin/{0}", "llvm-ar"))) + exeExtension;
RanlibPath = Path.Combine(Path.Combine(ToolsetRoot, string.Format("bin/{0}-{1}", ArchitectureName, "ranlib"))) + exeExtension;