diff --git a/Source/Engine/Renderer/AntiAliasing/TAA.h b/Source/Engine/Renderer/AntiAliasing/TAA.h index c4022a147..043aea637 100644 --- a/Source/Engine/Renderer/AntiAliasing/TAA.h +++ b/Source/Engine/Renderer/AntiAliasing/TAA.h @@ -37,7 +37,8 @@ private: #if COMPILE_WITH_DEV_ENV void OnShaderReloading(Asset* obj) { - _psTAA->ReleaseGPU(); + if (_psTAA) + _psTAA->ReleaseGPU(); invalidateResources(); } #endif diff --git a/Source/Shaders/Common.hlsl b/Source/Shaders/Common.hlsl index dc5cd6c16..d59513169 100644 --- a/Source/Shaders/Common.hlsl +++ b/Source/Shaders/Common.hlsl @@ -16,6 +16,9 @@ #if defined(PLATFORM_PS4) #include "./FlaxPlatforms/PS4/Shaders/PS4Common.hlsl" #endif +#if defined(PLATFORM_PS5) +#include "./FlaxPlatforms/PS5/Shaders/PS5Common.hlsl" +#endif // Feature levels #define FEATURE_LEVEL_ES2 0 @@ -202,14 +205,14 @@ float Luminance(float3 color) } // Samples the unwrapped 3D texture (eg. volume texture of size 16x16x16 would be unwrapped to 256x16) -half4 SampleUnwrappedTexture3D(Texture2D tex, SamplerState s, float3 uvw, float size) +float4 SampleUnwrappedTexture3D(Texture2D tex, SamplerState s, float3 uvw, float size) { float intW = floor(uvw.z * size - 0.5); half fracW = uvw.z * size - 0.5 - intW; float u = (uvw.x + intW) / size; float v = uvw.y; - half4 rg0 = tex.Sample(s, float2(u, v)); - half4 rg1 = tex.Sample(s, float2(u + 1.0f / size, v)); + float4 rg0 = tex.Sample(s, float2(u, v)); + float4 rg1 = tex.Sample(s, float2(u + 1.0f / size, v)); return lerp(rg0, rg1, fracW); } diff --git a/Source/Shaders/GammaCorrectionCommon.hlsl b/Source/Shaders/GammaCorrectionCommon.hlsl index 100fc047e..8b0aa79f8 100644 --- a/Source/Shaders/GammaCorrectionCommon.hlsl +++ b/Source/Shaders/GammaCorrectionCommon.hlsl @@ -37,22 +37,22 @@ float4 FastTonemapInvert(float4 c) return float4(FastTonemapInvert(c.rgb), c.a); } -half LinearToSrgbChannel(half linearColor) +float LinearToSrgbChannel(float linearColor) { if (linearColor < 0.00313067) return linearColor * 12.92; return pow(linearColor, (1.0 / 2.4)) * 1.055 - 0.055; } -half3 LinearToSrgb(half3 linearColor) +float3 LinearToSrgb(float3 linearColor) { - return half3( + return float3( LinearToSrgbChannel(linearColor.r), LinearToSrgbChannel(linearColor.g), LinearToSrgbChannel(linearColor.b)); } -half3 sRGBToLinear(half3 color) +float3 sRGBToLinear(float3 color) { color = max(6.10352e-5, color); return color > 0.04045 ? pow(color * (1.0 / 1.055) + 0.0521327, 2.4) : color * (1.0 / 12.92); diff --git a/Source/ThirdParty/freetype/freetype.Build.cs b/Source/ThirdParty/freetype/freetype.Build.cs index 88420b7e1..99b50f269 100644 --- a/Source/ThirdParty/freetype/freetype.Build.cs +++ b/Source/ThirdParty/freetype/freetype.Build.cs @@ -1,6 +1,5 @@ // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. -using System; using System.IO; using Flax.Build; using Flax.Build.NativeCpp; diff --git a/Source/Tools/Flax.Build/Configuration.cs b/Source/Tools/Flax.Build/Configuration.cs index 5a294ee6b..7abd39e09 100644 --- a/Source/Tools/Flax.Build/Configuration.cs +++ b/Source/Tools/Flax.Build/Configuration.cs @@ -232,6 +232,8 @@ namespace Flax.Build public static bool WithCSharp(NativeCpp.BuildOptions options) { + if (options.Platform.Target == TargetPlatform.PS5) + return false; // TODO: mono for ps5 return UseCSharp || options.Target.IsEditor; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/NewtonsoftJson.cs b/Source/Tools/Flax.Build/Deps/Dependencies/NewtonsoftJson.cs index 5d3683ef3..154c0b86b 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/NewtonsoftJson.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/NewtonsoftJson.cs @@ -27,6 +27,7 @@ namespace Flax.Deps.Dependencies TargetPlatform.XboxOne, TargetPlatform.XboxScarlett, TargetPlatform.PS4, + TargetPlatform.PS5, TargetPlatform.Switch, }; default: return new TargetPlatform[0]; @@ -81,6 +82,7 @@ namespace Flax.Deps.Dependencies case TargetPlatform.UWP: case TargetPlatform.XboxOne: case TargetPlatform.PS4: + case TargetPlatform.PS5: case TargetPlatform.XboxScarlett: case TargetPlatform.Switch: { diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs index b198dbf29..826800764 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs @@ -170,6 +170,7 @@ namespace Flax.Deps.Dependencies Utilities.DirectoryCopy( Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"), Path.Combine(root, "builds", "PS5"), false, true); + Utilities.ReplaceInFile(Path.Combine(root, "include\\freetype\\config\\ftstdlib.h"), "#define ft_getenv getenv", "char* ft_getenv(const char* n);"); // Build for PS5 var solutionPath = Path.Combine(root, "builds", "PS5", "freetype.sln"); diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs b/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs index 85514d5c8..a70f5263a 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs @@ -31,7 +31,6 @@ namespace Flax.Deps.Dependencies TargetPlatform.Windows, TargetPlatform.UWP, TargetPlatform.XboxOne, - TargetPlatform.PS4, TargetPlatform.XboxScarlett, TargetPlatform.Switch, }; @@ -573,11 +572,6 @@ namespace Flax.Deps.Dependencies Utilities.FilesDelete(dstMonoEditorLibs, "*.pdb", true); break; } - case TargetPlatform.PS4: - { - // TODO: implement automatic extraction of the package from mono-ps4-binaries - break; - } case TargetPlatform.XboxOne: { ConfigureMsvc(options, "v142", "10.0.19041.0", "0x0A00", "_XBOX_ONE=1;DISABLE_JIT;WINAPI_FAMILY=WINAPI_FAMILY_GAMES;HAVE_EXTERN_DEFINED_WINAPI_SUPPORT;CRITICAL_SECTION_NO_DEBUG_INFO=0x01000000");