diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl index cd7dd778610..9211d1dcb71 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl @@ -475,6 +475,8 @@ float4x4 GetRawUnityPrevWorldToObject() { return unity_MatrixPreviousMI; } // Undef the matrix error macros so that the DOTS instancing macro works #undef unity_ObjectToWorld #undef unity_WorldToObject +#undef unity_MatrixPreviousM +#undef unity_MatrixPreviousMI UNITY_DOTS_INSTANCING_START(BuiltinPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float3x4, unity_ObjectToWorld) UNITY_DOTS_INSTANCED_PROP(float3x4, unity_WorldToObject) @@ -511,8 +513,6 @@ UNITY_DOTS_INSTANCING_END(BuiltinPropertyMetadata) #define unity_SHBb UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadataunity_SHBb) #define unity_SHC UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadataunity_SHC) #define unity_ProbesOcclusion UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadataunity_ProbesOcclusion) -#define unity_MatrixPreviousM LoadDOTSInstancedData_float4x4_from_float3x4(UNITY_DOTS_INSTANCED_METADATA_NAME_FROM_MACRO(float3x4, Metadataunity_MatrixPreviousM)) -#define unity_MatrixPreviousMI LoadDOTSInstancedData_float4x4_from_float3x4(UNITY_DOTS_INSTANCED_METADATA_NAME_FROM_MACRO(float3x4, Metadataunity_MatrixPreviousMI)) #endif diff --git a/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl b/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl index 1e54b42d8fb..cf8331a38e5 100644 --- a/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl +++ b/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl @@ -5,6 +5,8 @@ #undef unity_ObjectToWorld #undef unity_WorldToObject +#undef unity_MatrixPreviousM +#undef unity_MatrixPreviousMI // TODO: This might not work correctly in all cases, double check! UNITY_DOTS_INSTANCING_START(BuiltinPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float3x4, unity_ObjectToWorld) @@ -26,9 +28,11 @@ UNITY_DOTS_INSTANCING_START(BuiltinPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float4, unity_SHBg) UNITY_DOTS_INSTANCED_PROP(float4, unity_SHBb) UNITY_DOTS_INSTANCED_PROP(float4, unity_SHC) + UNITY_DOTS_INSTANCED_PROP(float3x4, unity_MatrixPreviousM) + UNITY_DOTS_INSTANCED_PROP(float3x4, unity_MatrixPreviousMI) UNITY_DOTS_INSTANCING_END(BuiltinPropertyMetadata) -// Note: Macros for unity_ObjectToWorld and unity_WorldToObject are declared in UnityInstancing.hlsl +// Note: Macros for unity_ObjectToWorld, unity_WorldToObject, unity_MatrixPreviousM and unity_MatrixPreviousMI are declared in UnityInstancing.hlsl // because of some special handling #define unity_LODFade UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadataunity_LODFade) #define unity_WorldTransformParams UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadataunity_WorldTransformParams)