diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl index 43280100c26..507635aaffe 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl @@ -1,3 +1,5 @@ +#ifndef SHADOW_SAMPLING_TENT_INCLUDED +#define SHADOW_SAMPLING_TENT_INCLUDED // ------------------------------------------------------------------ // PCF Filtering Tent Functions // ------------------------------------------------------------------ @@ -242,3 +244,4 @@ void SampleShadow_ComputeSamples_Tent_7x7(real4 shadowMapTexture_TexelSize, real fetchesWeights[14] = fetchesWeightsU.z * fetchesWeightsV.w; fetchesWeights[15] = fetchesWeightsU.w * fetchesWeightsV.w; } +#endif diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7bb9d4c08b1..5a639b5f79c 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -29,6 +29,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where editing the Look Dev default profile would not reflect directly in the Look Dev window. - Fixed an issue where manipulating the color wheels in a volume component would reset the cursor every time. - Fixed an issue where static sky lighting would not be updated for a new scene until it's reloaded at least once. +- Fixed missing include guards in shadow hlsl files. + + ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAlgorithms.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAlgorithms.hlsl index 1aa7a294ab4..188c8dfe876 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAlgorithms.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAlgorithms.hlsl @@ -1,3 +1,6 @@ +#ifndef HD_SHADOW_ALGORITHMS_INCLUDED +#define HD_SHADOW_ALGORITHMS_INCLUDED + // Various shadow algorithms // There are two variants provided, one takes the texture and sampler explicitly so they can be statically passed in. // The variant without resource parameters dynamically accesses the texture when sampling. @@ -341,3 +344,4 @@ float EvalShadow_SampleClosestDistance_Punctual(HDShadowData sd, Texture2D tex, return distance(occluderPosWS, lightPositionWS); } +#endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSampling.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSampling.hlsl index a89d6292779..3480866c0a9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSampling.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSampling.hlsl @@ -1,3 +1,5 @@ +#ifndef HD_SHADOW_SAMPLING_INCLUDED +#define HD_SHADOW_SAMPLING_INCLUDED // Various shadow sampling logic. // Again two versions, one for dynamic resource indexing, one for static resource access. @@ -328,3 +330,4 @@ float SampleShadow_PCSS(float3 tcs, float2 posSS, float2 scale, float2 offset, f // shadowData.shadowFilterParams0.z = shadowRequest.maxDepthBias; // #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDIMS.hlsl" +#endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowMoments.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowMoments.hlsl index d5ded67dc81..bce8d31f69c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowMoments.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowMoments.hlsl @@ -1,3 +1,5 @@ +#ifndef SHADOW_MOMENTS_INCLUDED +#define SHADOW_MOMENTS_INCLUDED // Library header containing various useful functions for doing moment based shadow maps. // Supported flavors are VSM, EVSM and MSM @@ -131,3 +133,4 @@ float ShadowMoments_SolveDelta4MSM( float3 z, float4 b, float lightLeakBias) return saturate( ((1.0 - attenuation) - lightLeakBias) / (1.0 - lightLeakBias) ); } +#endif