From 15266ca98e8f232777f017560b92becd04baba71 Mon Sep 17 00:00:00 2001 From: Vincent Breysse Date: Tue, 7 Dec 2021 16:50:20 +0100 Subject: [PATCH] Fix HDRP build issues with DOTS_INSTANCING_ON shader variant --- .../CHANGELOG.md | 1 + .../ShaderLibrary/PickingSpaceTransforms.hlsl | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e701ce42cde..b74c37bf5f6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -50,6 +50,7 @@ The version number for this package has increased due to a version update of a r - Fixed atmospheric scattering being incorrectly enabled when scene lighting is disabled. - Fixed for changes of color curves not being applied immediately. - Fixed the rendering order of decals that have a similar draw order value. +- Fixed HDRP build issues with DOTS_INSTANCING_ON shader variant. ## [13.1.2] - 2021-11-05 diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl index 13e7d963a29..f5e08b75e33 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl @@ -10,12 +10,10 @@ #undef SHADEROPTIONS_CAMERA_RELATIVE_RENDERING // Define the correct matrices +#ifndef UNITY_DOTS_INSTANCING_ENABLED + #undef unity_ObjectToWorld #undef unity_MatrixPreviousM -#undef unity_MatrixVP -float4x4 unity_MatrixV; -float4x4 unity_MatrixVP; -float4x4 glstate_matrix_projection; #undef UNITY_MATRIX_M #define UNITY_MATRIX_M unity_ObjectToWorld @@ -29,6 +27,13 @@ float4x4 glstate_matrix_projection; #undef UNITY_PREV_MATRIX_I_M #define UNITY_PREV_MATRIX_I_M Inverse(unity_MatrixPreviousM) +#endif + +#undef unity_MatrixVP +float4x4 unity_MatrixV; +float4x4 unity_MatrixVP; +float4x4 glstate_matrix_projection; + #undef UNITY_MATRIX_V #define UNITY_MATRIX_V unity_MatrixV