diff --git a/.yamato/_postprocessing_publish.yml b/.yamato/_postprocessing_publish.yml index d9050e6477d..ee98674c6ac 100644 --- a/.yamato/_postprocessing_publish.yml +++ b/.yamato/_postprocessing_publish.yml @@ -3,11 +3,11 @@ name: postprocessing test_editors: - - 2020.3 - - 2019.4 - 2021.3 - - 2022.1 - - 2023.2 + - 2022.3 + - 6000.0 + - 6000.1 + - 6000.2 - trunk test_platforms: - name: win diff --git a/com.unity.postprocessing/CHANGELOG.md b/com.unity.postprocessing/CHANGELOG.md index 8c46dcbed95..c07022d8276 100644 --- a/com.unity.postprocessing/CHANGELOG.md +++ b/com.unity.postprocessing/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added -- +- Added Switch2 platform support ### Fixed - diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs index f59f69e2fda..515d8967b84 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs @@ -37,6 +37,9 @@ public static bool isTargetingConsoles #if UNITY_GAMECORE || t == BuildTarget.GameCoreXboxSeries || t == BuildTarget.GameCoreXboxOne +#endif +#if UNITY_SWITCH2 + || t == BuildTarget.Switch2 #endif || t == BuildTarget.Switch; } diff --git a/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl new file mode 100644 index 00000000000..bf2d2333360 --- /dev/null +++ b/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl @@ -0,0 +1,51 @@ +#define UNITY_UV_STARTS_AT_TOP 1 +#define UNITY_REVERSED_Z 1 +#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50) + +#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName +#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName + +#define TEXTURE2D(textureName) Texture2D textureName +#define SAMPLER2D(samplerName) SamplerState samplerName + +#define TEXTURE3D(textureName) Texture3D textureName +#define SAMPLER3D(samplerName) SamplerState samplerName + +#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName +#define TEXTURE2D_PARAM(textureName, samplerName) textureName, samplerName + +#define TEXTURE3D_ARGS(textureName, samplerName) Texture3D textureName, SamplerState samplerName +#define TEXTURE3D_PARAM(textureName, samplerName) textureName, samplerName + +#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) +#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + +#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + +#define LOAD_TEXTURE2D(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, 0)) +#define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, lod)) + +#define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) +#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) +#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) +#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + +#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r +#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + +#define UNITY_BRANCH [branch] +#define UNITY_FLATTEN [flatten] +#define UNITY_UNROLL [unroll] +#define UNITY_LOOP [loop] +#define UNITY_FASTOPT [fastopt] + +#define CBUFFER_START(name) cbuffer name { +#define CBUFFER_END }; + +#if UNITY_GATHER_SUPPORTED + #define FXAA_HLSL_5 1 + #define SMAA_HLSL_4_1 1 +#else + #define FXAA_HLSL_4 1 + #define SMAA_HLSL_4 1 +#endif diff --git a/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl.meta b/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl.meta new file mode 100644 index 00000000000..8314f508696 --- /dev/null +++ b/com.unity.postprocessing/PostProcessing/Shaders/API/Switch2.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7a0118b8201c6f14c922d56294ff686c +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl index 9259be0b63e..14c722580d8 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl @@ -23,6 +23,8 @@ #include "API/Vulkan.hlsl" #elif defined(SHADER_API_SWITCH) #include "API/Switch.hlsl" +#elif defined(SHADER_API_SWITCH2) + #include "API/Switch2.hlsl" #elif defined(SHADER_API_METAL) #include "API/Metal.hlsl" #elif defined(SHADER_API_PSP2) @@ -33,7 +35,7 @@ #include "API/OpenGL.hlsl" #endif -#if defined(SHADER_API_PSSL) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_SWITCH) || defined(SHADER_API_PSP2) +#if defined(SHADER_API_PSSL) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_SWITCH) || defined(SHADER_API_SWITCH2) || defined(SHADER_API_PSP2) #define SHADER_API_CONSOLE #endif