diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 883cb12e181..8aa9d857007 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed normal bias field of reference volume being wrong until the profile UI was displayed. - Fixed L2 for Probe Volumes. - Fixed assertion on compression of L1 coefficients for Probe Volume. +- Explicit half precision not working even when Unified Shader Precision Model is enabled. - Fixed ACES filter artefact due to half float error on some mobile platforms. - Fixed issue displaying a warning of different probe reference volume profiles even when they are equivalent. - Fixed missing increment/decrement controls from DebugUIIntField & DebugUIUIntField widget prefabs. diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index e15a1cd02ff..88af65a9f1f 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -87,6 +87,20 @@ #define REAL_IS_HALF 0 #endif // Do we have half? +#if REAL_IS_HALF || (defined(UNITY_UNIFIED_SHADER_PRECISION_MODEL) && (defined(UNITY_COMPILER_HLSL) || defined(UNITY_COMPILER_DXC))) +#define half min16float +#define half2 min16float2 +#define half3 min16float3 +#define half4 min16float4 +#define half2x2 min16float2x2 +#define half2x3 min16float2x3 +#define half3x2 min16float3x2 +#define half3x3 min16float3x3 +#define half3x4 min16float3x4 +#define half4x3 min16float4x3 +#define half4x4 min16float4x4 +#endif + #if REAL_IS_HALF #define real half #define real2 half2 @@ -102,19 +116,6 @@ #define real4x3 half4x3 #define real4x4 half4x4 -#define half min16float -#define half2 min16float2 -#define half3 min16float3 -#define half4 min16float4 - -#define half2x2 min16float2x2 -#define half2x3 min16float2x3 -#define half3x2 min16float3x2 -#define half3x3 min16float3x3 -#define half3x4 min16float3x4 -#define half4x3 min16float4x3 -#define half4x4 min16float4x4 - #define REAL_MIN HALF_MIN #define REAL_MAX HALF_MAX #define REAL_EPS HALF_EPS