Fix shader compilation errors related to UpsampleShadowFactors.

#jira UE-195969
#rb none

[CL 28039731 by tiago costa in ue5-main branch]
This commit is contained in:
tiago costa
2023-09-20 12:09:18 -04:00
parent f5c7921948
commit 3258f8f9e4
4 changed files with 15 additions and 5 deletions

View File

@@ -13,16 +13,16 @@
#include "ReflectionEnvironmentShared.ush"
#include "Substrate/Substrate.ush"
#ifdef SHADOW_FACTORS_UPSAMPLE_REQUIRED
#ifdef UPSAMPLE_PASS
# include "ShadowFactorsUpsampleCommon.ush"
#endif
#ifndef THREADGROUP_SIZEX
#define THREADGROUP_SIZEX 1
# define THREADGROUP_SIZEX 1
#endif
#ifndef THREADGROUP_SIZEY
#define THREADGROUP_SIZEY 1
# define THREADGROUP_SIZEY 1
#endif
#ifndef LIGHT_SOURCE_MODE
@@ -1186,6 +1186,8 @@ void CapsuleShadowingUpsampleVS(
}
}
#ifdef UPSAMPLE_PASS
Texture2D ShadowFactorsTexture;
SamplerState ShadowFactorsSampler;
@@ -1222,4 +1224,6 @@ void CapsuleShadowingUpsamplePS(
#if APPLY_TO_SSAO
OutAmbientOcclusion = Output;
#endif
}
}
#endif // UPSAMPLE_PASS

View File

@@ -11,7 +11,7 @@
#include "DistanceFieldShadowingShared.ush"
#include "Substrate/Substrate.ush"
#ifdef SHADOW_FACTORS_UPSAMPLE_REQUIRED
#ifdef UPSAMPLE_PASS
# include "ShadowFactorsUpsampleCommon.ush"
#endif
@@ -772,6 +772,8 @@ void DistanceFieldShadowingCS(
RWShadowFactors[DispatchThreadId.xy] = float2(Result, SceneDepth);
}
#ifdef UPSAMPLE_PASS
float FadePlaneOffset;
float InvFadePlaneLength;
float NearFadePlaneOffset;
@@ -796,6 +798,8 @@ void DistanceFieldShadowingUpsamplePS(
OutColor = EncodeLightAttenuation(half4(Output, Output, Output, Output));
}
#endif // UPSAMPLE_PASS
#ifdef SHADOW_TILE_VS
Buffer<uint> TileListData;

View File

@@ -344,6 +344,7 @@ public:
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters& Parameters, FShaderCompilerEnvironment& OutEnvironment)
{
OutEnvironment.SetDefine(TEXT("UPSAMPLE_PASS"), 1);
OutEnvironment.SetDefine(TEXT("DOWNSAMPLE_FACTOR"), 2);
}
};

View File

@@ -360,6 +360,7 @@ class FDistanceFieldShadowingUpsamplePS : public FGlobalShader
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters& Parameters, FShaderCompilerEnvironment& OutEnvironment)
{
OutEnvironment.SetDefine(TEXT("UPSAMPLE_PASS"), 1);
OutEnvironment.SetDefine(TEXT("FORCE_DEPTH_TEXTURE_READS"), 1);
}
};