Skip to content

Commit 4bcb19f

Browse files
madkins-71Evergreen
authored andcommitted
Revert "Overdraw support"
This reverts PR 49800 UUM-64493 (main-case) / UUM-64893 (6000.0-port) as there are concerns and a need to make sure the LTS diamond team is aligned at the architects level. https://unity.slack.com/archives/C0105CH72UV/p1718967724155289?thread_ts=1709721185.519149&cid=C0105CH72UV
1 parent 2518096 commit 4bcb19f

18 files changed

+13
-200
lines changed
Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
2-
#if defined(DEBUG_DISPLAY)
3-
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
4-
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
5-
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
6-
#endif
7-
81
PackedVaryings vert(Attributes input)
92
{
103
Varyings output = (Varyings)0;
@@ -31,20 +24,5 @@ half4 frag(PackedVaryings packedInput) : SV_TARGET
3124
#endif
3225

3326
half4 color = half4(surfaceDescription.BaseColor, alpha);
34-
35-
#if defined(DEBUG_DISPLAY)
36-
SurfaceData2D surfaceData;
37-
InitializeSurfaceData(color.rgb, color.a, surfaceData);
38-
InputData2D inputData;
39-
InitializeInputData(unpacked.positionCS.xy, half2(unpacked.positionCS.xy), inputData);
40-
half4 debugColor = 0;
41-
42-
SETUP_DEBUG_DATA_2D(inputData, unpacked.positionCS, unpacked.positionCS);
43-
44-
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
45-
{
46-
return debugColor;
47-
}
48-
#endif
4927
return color;
5028
}

Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public static SubShaderDescriptor LitSubShader(UniversalTarget target, WorkflowM
371371
// UI shaders to render correctly. Verify [1352225] before changing this order.
372372
result.passes.Add(PassVariant(CorePasses.SceneSelection(target), CorePragmas.Default));
373373
result.passes.Add(PassVariant(CorePasses.ScenePicking(target), CorePragmas.Default));
374-
result.passes.Add(LitPasses._2D(target, LitKeywords._2D));
374+
result.passes.Add(PassVariant(LitPasses._2D(target), CorePragmas.Default));
375375

376376
return result;
377377
}
@@ -580,7 +580,7 @@ public static PassDescriptor Meta(UniversalTarget target)
580580
return result;
581581
}
582582

583-
public static PassDescriptor _2D(UniversalTarget target, KeywordCollection keywords)
583+
public static PassDescriptor _2D(UniversalTarget target)
584584
{
585585
var result = new PassDescriptor()
586586
{
@@ -603,9 +603,9 @@ public static PassDescriptor _2D(UniversalTarget target, KeywordCollection keywo
603603

604604
// Conditional State
605605
renderStates = CoreRenderStates.UberSwitchedRenderState(target),
606-
pragmas = CorePragmas._2DDefault,
606+
pragmas = CorePragmas.Instanced,
607607
defines = new DefineCollection(),
608-
keywords = new KeywordCollection { keywords },
608+
keywords = new KeywordCollection(),
609609
includes = LitIncludes._2D,
610610

611611
// Custom Interpolator Support
@@ -869,11 +869,6 @@ static class LitKeywords
869869
{ CoreKeywordDescriptors.RenderPassEnabled },
870870
{ CoreKeywordDescriptors.DebugDisplay },
871871
};
872-
873-
public static readonly KeywordCollection _2D = new KeywordCollection
874-
{
875-
{ CoreKeywordDescriptors.DebugDisplay },
876-
};
877872
}
878873
#endregion
879874

Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#if !defined(SPRITE_MASK_SHARED)
33
#define SPRITE_MASK_SHARED
44

5-
#if defined(DEBUG_DISPLAY)
6-
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
7-
#endif
5+
86
// alpha below which a mask should discard a pixel, thereby preventing the stencil buffer from being marked with the Mask's presence
97
half _Cutoff;
108

@@ -38,16 +36,7 @@ half4 MaskRenderingFragment(Varyings input) : SV_Target
3836
half4 c = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
3937
// for masks: discard pixel if alpha falls below MaskingCutoff
4038
clip(c.a - _Cutoff);
41-
#if defined(DEBUG_DISPLAY)
42-
half4 debugColor = 0;
43-
SurfaceData2D surfaceData;
44-
InitializeSurfaceData(1.0f, 1.0f, surfaceData);
45-
InputData2D inputData;
46-
InitializeInputData(input.positionCS, input.uv, inputData);
47-
48-
if(CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
49-
return debugColor;
50-
#endif
39+
5140
return half4(1, 1, 1, 0.2);
5241
}
5342

Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Mask.shader

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Mask"
3434
HLSLPROGRAM
3535
#pragma vertex MaskRenderingVertex
3636
#pragma fragment MaskRenderingFragment
37-
#pragma multi_compile _ DEBUG_DISPLAY
3837

3938
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
4039
ENDHLSL
@@ -45,7 +44,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Mask"
4544
HLSLPROGRAM
4645
#pragma vertex MaskRenderingVertex
4746
#pragma fragment MaskRenderingFragment
48-
#pragma multi_compile _ DEBUG_DISPLAY
4947

5048
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
5149
ENDHLSL
@@ -56,7 +54,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Mask"
5654
HLSLPROGRAM
5755
#pragma vertex MaskRenderingVertex
5856
#pragma fragment MaskRenderingFragment
59-
#pragma multi_compile _ DEBUG_DISPLAY
6057

6158
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
6259
ENDHLSL

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_Bitmap-Custom-Atlas.shader

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ SubShader{
5252

5353
#pragma multi_compile __ UNITY_UI_CLIP_RECT
5454
#pragma multi_compile __ UNITY_UI_ALPHACLIP
55-
#pragma multi_compile _ DEBUG_DISPLAY
5655

57-
#include "UnityCG.cginc"
5856

59-
#if defined(DEBUG_DISPLAY)
60-
#include "Debugging2D.cginc"
61-
#endif
57+
#include "UnityCG.cginc"
6258

6359
struct appdata_t
6460
{
@@ -133,11 +129,6 @@ SubShader{
133129
clip(color.a - 0.001);
134130
#endif
135131

136-
#if defined(DEBUG_DISPLAY)
137-
fixed4 debugColor = 0;
138-
if(CanDebugOverrideOutputColor(debugColor))
139-
return debugColor;
140-
#endif
141132
return color;
142133
}
143134
ENDCG

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_Bitmap-Mobile.shader

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ SubShader {
5252

5353
#pragma multi_compile __ UNITY_UI_CLIP_RECT
5454
#pragma multi_compile __ UNITY_UI_ALPHACLIP
55-
#pragma multi_compile _ DEBUG_DISPLAY
5655

57-
#include "UnityCG.cginc"
5856

59-
#if defined(DEBUG_DISPLAY)
60-
#include "Debugging2D.cginc"
61-
#endif
57+
#include "UnityCG.cginc"
6258

6359
struct appdata_t
6460
{
@@ -127,11 +123,7 @@ SubShader {
127123
#if UNITY_UI_ALPHACLIP
128124
clip(color.a - 0.001);
129125
#endif
130-
#if defined(DEBUG_DISPLAY)
131-
fixed4 debugColor = 0;
132-
if(CanDebugOverrideOutputColor(debugColor))
133-
return debugColor;
134-
#endif
126+
135127
return color;
136128
}
137129
ENDCG

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_Bitmap.shader

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,12 @@ SubShader{
4949
#pragma vertex vert
5050
#pragma fragment frag
5151

52-
#pragma multi_compile _ DEBUG_DISPLAY
5352
#pragma multi_compile __ UNITY_UI_CLIP_RECT
5453
#pragma multi_compile __ UNITY_UI_ALPHACLIP
5554

5655

5756
#include "UnityCG.cginc"
5857

59-
#if defined(DEBUG_DISPLAY)
60-
#include "Debugging2D.cginc"
61-
#endif
62-
6358
struct appdata_t
6459
{
6560
float4 vertex : POSITION;
@@ -134,12 +129,6 @@ SubShader{
134129
clip(color.a - 0.001);
135130
#endif
136131

137-
#if defined(DEBUG_DISPLAY)
138-
fixed4 debugColor = 0;
139-
if(CanDebugOverrideOutputColor(debugColor))
140-
return debugColor;
141-
#endif
142-
143132
return color;
144133
}
145134
ENDCG

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ SubShader {
119119
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
120120
#pragma shader_feature __ GLOW_ON
121121

122-
#pragma multi_compile _ DEBUG_DISPLAY
123122
#pragma multi_compile __ UNITY_UI_CLIP_RECT
124123
#pragma multi_compile __ UNITY_UI_ALPHACLIP
125124

@@ -128,10 +127,6 @@ SubShader {
128127
#include "TMPro_Properties.cginc"
129128
#include "TMPro.cginc"
130129

131-
#if defined(DEBUG_DISPLAY)
132-
#include "Debugging2D.cginc"
133-
#endif
134-
135130
struct vertex_t
136131
{
137132
UNITY_VERTEX_INPUT_INSTANCE_ID
@@ -315,12 +310,6 @@ SubShader {
315310
clip(faceColor.a - 0.001);
316311
#endif
317312

318-
#if defined(DEBUG_DISPLAY)
319-
fixed4 debugColor = 0;
320-
if(CanDebugOverrideOutputColor(debugColor))
321-
return debugColor;
322-
#endif
323-
324313
return faceColor * input.color.a;
325314
}
326315
ENDCG

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_SDF SSD.shader

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,12 @@ SubShader {
122122

123123
#pragma multi_compile __ UNITY_UI_CLIP_RECT
124124
#pragma multi_compile __ UNITY_UI_ALPHACLIP
125-
#pragma multi_compile _ DEBUG_DISPLAY
126125

127126
#include "UnityCG.cginc"
128127
#include "UnityUI.cginc"
129128
#include "TMPro_Properties.cginc"
130129
#include "TMPro.cginc"
131130

132-
#if defined(DEBUG_DISPLAY)
133-
#include "Debugging2D.cginc"
134-
#endif
135-
136131
struct vertex_t
137132
{
138133
UNITY_VERTEX_INPUT_INSTANCE_ID
@@ -310,12 +305,6 @@ SubShader {
310305
clip(faceColor.a - 0.001);
311306
#endif
312307

313-
#if defined(DEBUG_DISPLAY)
314-
fixed4 debugColor = 0;
315-
if(CanDebugOverrideOutputColor(debugColor))
316-
return debugColor;
317-
#endif
318-
319308
return faceColor * input.color.a;
320309
}
321310
ENDCG

Tests/SRPTests/Projects/MultipleSRP_Tests/Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile Masking.shader

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,12 @@ SubShader {
9393

9494
#pragma multi_compile __ UNITY_UI_CLIP_RECT
9595
#pragma multi_compile __ UNITY_UI_ALPHACLIP
96-
#pragma multi_compile _ DEBUG_DISPLAY
96+
9797

9898
#include "UnityCG.cginc"
9999
#include "UnityUI.cginc"
100100
#include "TMPro_Properties.cginc"
101101

102-
#if defined(DEBUG_DISPLAY)
103-
#include "Debugging2D.cginc"
104-
#endif
105-
106102
struct vertex_t
107103
{
108104
float4 vertex : POSITION;
@@ -247,12 +243,6 @@ SubShader {
247243
clip(c.a - 0.001);
248244
#endif
249245

250-
#if defined(DEBUG_DISPLAY)
251-
fixed4 debugColor = 0;
252-
if(CanDebugOverrideOutputColor(debugColor))
253-
return debugColor;
254-
#endif
255-
256246
return c;
257247
}
258248
ENDCG

0 commit comments

Comments
 (0)