Skip to content

Commit 74b43d8

Browse files
thomas-zengEvergreen
authored andcommitted
Fixed Subpass enum shader keyword does not match actual shader keyword.
1 parent ab3734a commit 74b43d8

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Nodes/FetchSceneDepthNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static string Unity_FetchSceneDepth_Linear01(
9494
return
9595
@"
9696
{
97-
#if defined(DEPTH_AS_INPUT_ATTACHMENT) || defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
97+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT) || defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
9898
// Fetch depth from tile memory using input attachment
9999
float rawDepth = shadergraph_LWFetchSceneDepth(clipPos.xy);
100100
Out = Linear01Depth(rawDepth, _ZBufferParams);
@@ -113,7 +113,7 @@ static string Unity_FetchSceneDepth_Raw(
113113
return
114114
@"
115115
{
116-
#if defined(DEPTH_AS_INPUT_ATTACHMENT) || defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
116+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT) || defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
117117
// Fetch raw depth from tile memory using input attachment
118118
Out = shadergraph_LWFetchSceneDepth(clipPos.xy);
119119
#else
@@ -131,7 +131,7 @@ static string Unity_FetchSceneDepth_Eye(
131131
return
132132
@"
133133
{
134-
#if defined(DEPTH_AS_INPUT_ATTACHMENT) || defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
134+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT) || defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
135135
// Fetch depth from tile memory using input attachment
136136
float rawDepth = shadergraph_LWFetchSceneDepth(clipPos.xy);
137137
{

Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,10 +1480,10 @@ public static class ShaderKeywordStrings
14801480
public const string Msaa4 = "_MSAA_4";
14811481

14821482
/// <summary> Keyword used for depth as input attachment. </summary>
1483-
public const string DEPTH_AS_INPUT_ATTACHMENT = "DEPTH_AS_INPUT_ATTACHMENT";
1483+
public const string DEPTH_AS_INPUT_ATTACHMENT = "_DEPTH_AS_INPUT_ATTACHMENT";
14841484

14851485
/// <summary> Keyword used for depth as input attachment MSAA. </summary>
1486-
public const string DEPTH_AS_INPUT_ATTACHMENT_MSAA = "DEPTH_AS_INPUT_ATTACHMENT_MSAA";
1486+
public const string DEPTH_AS_INPUT_ATTACHMENT_MSAA = "_DEPTH_AS_INPUT_ATTACHMENT_MSAA";
14871487
}
14881488

14891489
public sealed partial class UniversalRenderPipeline

Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ float4 _CameraDepthTexture_TexelSize;
1010
#define sampler_CameraDepthTexture sampler_PointClamp
1111

1212
// Framebuffer fetch API for depth input attachment
13-
#if defined(DEPTH_AS_INPUT_ATTACHMENT)
13+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT)
1414
FRAMEBUFFER_INPUT_X_FLOAT(0);
1515

1616
float FetchSceneDepth(float2 fragCoord)
1717
{
1818
float depth = LOAD_FRAMEBUFFER_INPUT_X(0, fragCoord).r;
1919
return depth;
2020
}
21-
#elif defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
21+
#elif defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
2222
FRAMEBUFFER_INPUT_X_FLOAT_MS(0);
2323

2424
float FetchSceneDepth(float2 fragCoord, int sampleIndx)

Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ float shadergraph_LWSampleSceneDepth(float2 uv)
3535
#endif
3636
}
3737

38-
#if defined(DEPTH_AS_INPUT_ATTACHMENT)
38+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT)
3939
float shadergraph_LWFetchSceneDepth(float2 fragCoord)
4040
{
4141
#if defined(REQUIRE_DEPTH_TEXTURE)
@@ -44,7 +44,7 @@ float shadergraph_LWSampleSceneDepth(float2 uv)
4444
return 0;
4545
#endif
4646
}
47-
#elif defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
47+
#elif defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
4848
float shadergraph_LWFetchSceneDepth(float2 fragCoord)
4949
{
5050
#if defined(REQUIRE_DEPTH_TEXTURE)

Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Scenes/365_RenderObject_DepthInputAttachment/CustomFetchDepth.shader

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Shader "CustomFetchDepth"
2020
#pragma vertex Vert
2121
#pragma fragment FragDepthVisualization
2222
#pragma target 4.5
23-
#pragma multi_compile _ DEPTH_AS_INPUT_ATTACHMENT DEPTH_AS_INPUT_ATTACHMENT_MSAA
23+
#pragma multi_compile _ _DEPTH_AS_INPUT_ATTACHMENT _DEPTH_AS_INPUT_ATTACHMENT_MSAA
2424
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
2525
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
2626

@@ -47,15 +47,15 @@ Shader "CustomFetchDepth"
4747
return output;
4848
}
4949

50-
#if defined(DEPTH_AS_INPUT_ATTACHMENT)
50+
#if defined(_DEPTH_AS_INPUT_ATTACHMENT)
5151
float4 FragDepthVisualization(Varyings input) : SV_Target0
5252
{
5353
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
5454

5555
float depth = FetchSceneDepth(input.positionCS.xy);
5656
return float4(depth, 0.0f, 0.0f, 1.0);
5757
}
58-
#elif defined(DEPTH_AS_INPUT_ATTACHMENT_MSAA)
58+
#elif defined(_DEPTH_AS_INPUT_ATTACHMENT_MSAA)
5959
float4 FragDepthVisualization(Varyings input) : SV_Target0
6060
{
6161
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);

0 commit comments

Comments
 (0)