Skip to content

Commit c953ae8

Browse files
revert: [HDRP] Merge Hd/bugfix (#4713)
1 parent 6325f22 commit c953ae8

File tree

10 files changed

+22
-109
lines changed

10 files changed

+22
-109
lines changed

com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.ContextualMenu.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static void ResetLight(MenuCommand menuCommand)
2727

2828
Light light = go.GetComponent<Light>();
2929
HDAdditionalLightData lightAdditionalData = go.GetComponent<HDAdditionalLightData>();
30-
HDLightType lightType = lightAdditionalData.type;
3130

3231
Assert.IsNotNull(light);
3332
Assert.IsNotNull(lightAdditionalData);
@@ -37,7 +36,6 @@ static void ResetLight(MenuCommand menuCommand)
3736
// To avoid duplicating init code we copy default settings to Reset additional data
3837
// Note: we can't call this code inside the HDAdditionalLightData, thus why we don't wrap it in a Reset() function
3938
HDUtils.s_DefaultHDAdditionalLightData.CopyTo(lightAdditionalData);
40-
lightAdditionalData.type = lightType;
4139

4240
//reinit default intensity
4341
HDAdditionalLightData.InitDefaultHDAdditionalLightData(lightAdditionalData);

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ public class Styles
149149
public static readonly GUIContent supportedRayTracingMode = EditorGUIUtility.TrTextContent("Supported Ray Tracing Mode (Preview)");
150150
public static readonly GUIContent rayTracingUnsupportedWarning = EditorGUIUtility.TrTextContent("Ray tracing is not supported on your device. Please refer to the documentation.");
151151
public static readonly GUIContent rayTracingDX12OnlyWarning = EditorGUIUtility.TrTextContent("Ray tracing is currently only supported on DX12.");
152-
public static readonly GUIContent rayTracingMSAAUnsupported = EditorGUIUtility.TrTextContent("When Ray tracing is enabled in asset, MSAA is not supported. Please refer to the documentation.");
153152
public static readonly GUIContent maximumLODLevel = EditorGUIUtility.TrTextContent("Maximum LOD Level");
154153
public static readonly GUIContent LODBias = EditorGUIUtility.TrTextContent("LOD Bias");
155154
public static readonly GUIContent supportProbeVolumeContent = EditorGUIUtility.TrTextContent("Enable", "When enabled, HDRP allocates Shader variants and memory for probe volume based GI. This allows you to use probe volumes in your Unity Project.");

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,26 +1138,17 @@ static void Drawer_SectionRenderingUnsorted(SerializedHDRenderPipelineAsset seri
11381138
// MSAA is an option that is only available in full forward but Camera can be set in Full Forward only. Thus MSAA have no dependency currently
11391139
//Note: do not use SerializedProperty.enumValueIndex here as this enum not start at 0 as it is used as flags.
11401140
bool msaaAllowed = true;
1141-
bool hasRayTracing = false;
11421141
for (int index = 0; index < serialized.serializedObject.targetObjects.Length && msaaAllowed; ++index)
11431142
{
1144-
var settings = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings;
1145-
var litShaderMode = settings.supportedLitShaderMode;
1146-
bool rayTracedSupported = settings.supportRayTracing;
1147-
hasRayTracing |= rayTracedSupported;
1148-
msaaAllowed &= (litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both) && !rayTracedSupported;
1143+
var litShaderMode = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings.supportedLitShaderMode;
1144+
msaaAllowed &= litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both;
11491145
}
1150-
11511146
using (new EditorGUI.DisabledScope(!msaaAllowed))
11521147
{
11531148
++EditorGUI.indentLevel;
11541149
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.MSAASampleCount, Styles.MSAASampleCountContent);
11551150
--EditorGUI.indentLevel;
11561151
}
1157-
if (hasRayTracing && serialized.renderPipelineSettings.MSAASampleCount.intValue != (int)MSAASamples.None)
1158-
{
1159-
EditorGUILayout.HelpBox(Styles.rayTracingMSAAUnsupported.text, MessageType.Info, wide: true);
1160-
}
11611152

11621153
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportMotionVectors, Styles.supportMotionVectorContent);
11631154
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportRuntimeDebugDisplay, Styles.supportRuntimeDebugDisplayContent);

com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -802,39 +802,12 @@ void CustomRender(ScriptableRenderContext context, HDCamera camera)
802802

803803
if (camera.camera.targetTexture)
804804
{
805-
// When rendering to texture (or to camera bridge) we don't need to flip the image.
806-
// If this matrix was used for the game view, then the image would appear flipped, hense the name of the variable.
807805
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
808806
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
809807
cmd.Blit(null, camera.camera.targetTexture, m_Material, m_Material.FindPass("ForwardOnly"));
810-
811-
var recorderCaptureActions = CameraCaptureBridge.GetCaptureActions(camera.camera);
812-
if (recorderCaptureActions != null)
813-
{
814-
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
815-
{
816-
recorderCaptureActions.Current(camera.camera.targetTexture, cmd);
817-
}
818-
}
819808
}
820809
else
821810
{
822-
var recorderCaptureActions = CameraCaptureBridge.GetCaptureActions(camera.camera);
823-
824-
if (recorderCaptureActions != null)
825-
{
826-
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
827-
cmd.SetInvertCulling(true);
828-
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
829-
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));
830-
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
831-
{
832-
recorderCaptureActions.Current(BuiltinRenderTextureType.CameraTarget, cmd);
833-
}
834-
cmd.SetInvertCulling(false);
835-
}
836-
837-
// When we render directly to game view, we render the image flipped up-side-down, like other HDRP cameras
838811
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrix;
839812
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
840813
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));

com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFData.hlsl

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,10 @@ struct TextureUVMapping
9898
#endif
9999

100100
#define GETSURFACEANDBUILTINDATA_RAYCONE_PARAM ((RayCone)0)
101-
102-
#if !defined(SHADER_API_VULKAN)
103101
#define AXF_CALCULATE_TEXTURE2D_LOD(a,b,c,duvdx,duvdy,scales,texelSize,rayCone) CALCULATE_TEXTURE2D_LOD(a,b,c)
104-
#else
105-
// case 1335737: For Vulkan, our HLSLcc is missing an overloaded version when the texture object is a Texture2DArray.
106-
// This won't create a problem anyway if we use gradients instead of LOD sampling, we just make sure the shader is
107-
// configured as such on this platform. We also place a dummy macro since although eventually optimized out, HLSLcc
108-
// will fail before the optimization prunes it out.
109-
#define AXF_CALCULATE_TEXTURE2D_LOD(a,b,c,duvdx,duvdy,scales,texelSize,rayCone) (0)
110-
111-
#ifndef FLAKES_USE_DDXDDY
112-
#define FLAKES_USE_DDXDDY
113-
#endif
114-
115-
#endif // #if !defined(SHADER_API_VULKAN)
116102

117103
#else
104+
118105
//-----------------------------------------------------------------------------
119106
//defined(SHADER_STAGE_RAY_TRACING)
120107

@@ -649,17 +636,8 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p
649636

650637
// The AxF models include both a general coloring term that they call "specular color" while the f0 is actually another term,
651638
// seemingly always scalar:
652-
#ifndef DEBUG_DISPLAY
653639
surfaceData.fresnel0 = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_FresnelMap, sampler_SVBRDF_FresnelMap, uvMapping).x;
654640
surfaceData.height_mm = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_HeightMap, sampler_SVBRDF_HeightMap, uvMapping).x * _SVBRDF_HeightMapMaxMM;
655-
#else
656-
// [case 1333780]: For debug display we run out of samplers (max 16 on dx11/ps5.0) in certain configurations for two reasons:
657-
// - An extra sampler is used for mat cap
658-
// - The auto-generated debug code can visualize all texture properties so nothing is stripped out (unlike the non-debug case)
659-
// To save sampler states in Debug, we reuse the sampler state of the color map for some other maps too.
660-
surfaceData.fresnel0 = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_FresnelMap, sampler_SVBRDF_DiffuseColorMap, uvMapping).x;
661-
surfaceData.height_mm = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_HeightMap, sampler_SVBRDF_DiffuseColorMap, uvMapping).x * _SVBRDF_HeightMapMaxMM;
662-
#endif
663641
// Our importer range remaps the [-HALF_PI, HALF_PI) range to [0,1). We map back here:
664642
surfaceData.anisotropyAngle =
665643
HALF_PI * (2.0 * AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_AnisoRotationMap, sampler_SVBRDF_AnisoRotationMap, uvMapping).x - 1.0);

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Shader "Hidden/HDRP/TemporalAA"
1616
#pragma multi_compile_local_fragment _ ANTI_RINGING
1717
#pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY POST_DOF
1818

19-
#pragma editor_sync_compilation
20-
2119
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
2220

2321
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public struct ViewConstants
9494
public bool volumetricHistoryIsValid = false;
9595

9696
internal int volumetricValidFrames = 0;
97-
internal int colorPyramidHistoryValidFrames = 0;
9897

9998
/// <summary>Width actually used for rendering after dynamic resolution and XR is applied.</summary>
10099
public int actualWidth { get; private set; }
@@ -148,7 +147,6 @@ public void Reset()
148147
volumetricHistoryIsValid = false;
149148
volumetricValidFrames = 0;
150149
colorPyramidHistoryIsValid = false;
151-
colorPyramidHistoryValidFrames = 0;
152150
dofHistoryIsValid = false;
153151

154152
// Reset the volumetric cloud offset animation data
@@ -1676,11 +1674,6 @@ Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
16761674
planes.top += planeJitter.y;
16771675
planes.bottom += planeJitter.y;
16781676

1679-
// Reconstruct the far plane for the jittered matrix.
1680-
// For extremely high far clip planes, the decomposed projection zFar evaluates to infinity.
1681-
if (float.IsInfinity(planes.zFar))
1682-
planes.zFar = frustum.planes[5].distance;
1683-
16841677
proj = Matrix4x4.Frustum(planes);
16851678
}
16861679

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ class RenderSSRPassData
403403
public bool usePBRAlgo;
404404
public bool accumNeedClear;
405405
public bool previousAccumNeedClear;
406-
public bool validColorPyramid;
407406

408407
public int width, height, viewCount;
409408

@@ -512,7 +511,6 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
512511
passData.accumNeedClear = usePBRAlgo;
513512
passData.previousAccumNeedClear = usePBRAlgo && (hdCamera.currentSSRAlgorithm == ScreenSpaceReflectionAlgorithm.Approximation || hdCamera.isFirstFrame || hdCamera.resetPostProcessingHistory);
514513
hdCamera.currentSSRAlgorithm = volumeSettings.usedAlgorithm.value; // Store for next frame comparison
515-
passData.validColorPyramid = hdCamera.colorPyramidHistoryValidFrames > 1;
516514

517515
passData.depthBuffer = builder.ReadTexture(prepassOutput.depthBuffer);
518516
passData.depthPyramid = builder.ReadTexture(prepassOutput.depthPyramidTexture);
@@ -605,30 +603,22 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
605603

606604
if (data.usePBRAlgo)
607605
{
608-
if (!data.validColorPyramid)
606+
using (new ProfilingScope(ctx.cmd, ProfilingSampler.Get(HDProfileId.SsrAccumulate)))
609607
{
610-
CoreUtils.SetRenderTarget(ctx.cmd, data.ssrAccum, ClearFlag.Color, Color.clear);
611-
CoreUtils.SetRenderTarget(ctx.cmd, data.ssrAccumPrev, ClearFlag.Color, Color.clear);
612-
}
613-
else
614-
{
615-
using (new ProfilingScope(ctx.cmd, ProfilingSampler.Get(HDProfileId.SsrAccumulate)))
616-
{
617-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._DepthTexture, data.depthBuffer);
618-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraDepthTexture, data.depthPyramid);
619-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._NormalBufferTexture, data.normalBuffer);
620-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._ColorPyramidTexture, data.colorPyramid);
621-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrHitPointTexture, data.hitPointsTexture);
622-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SSRAccumTexture, data.ssrAccum);
623-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrLightingTextureRW, data.lightingTexture);
624-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrAccumPrev, data.ssrAccumPrev);
625-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrClearCoatMaskTexture, data.clearCoatMask);
626-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraMotionVectorsTexture, data.motionVectorsBuffer);
627-
628-
ConstantBuffer.Push(ctx.cmd, data.cb, cs, HDShaderIDs._ShaderVariablesScreenSpaceReflection);
629-
630-
ctx.cmd.DispatchCompute(cs, data.accumulateKernel, HDUtils.DivRoundUp(data.width, 8), HDUtils.DivRoundUp(data.height, 8), data.viewCount);
631-
}
608+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._DepthTexture, data.depthBuffer);
609+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraDepthTexture, data.depthPyramid);
610+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._NormalBufferTexture, data.normalBuffer);
611+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._ColorPyramidTexture, data.colorPyramid);
612+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrHitPointTexture, data.hitPointsTexture);
613+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SSRAccumTexture, data.ssrAccum);
614+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrLightingTextureRW, data.lightingTexture);
615+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrAccumPrev, data.ssrAccumPrev);
616+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrClearCoatMaskTexture, data.clearCoatMask);
617+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraMotionVectorsTexture, data.motionVectorsBuffer);
618+
619+
ConstantBuffer.Push(ctx.cmd, data.cb, cs, HDShaderIDs._ShaderVariablesScreenSpaceReflection);
620+
621+
ctx.cmd.DispatchCompute(cs, data.accumulateKernel, HDUtils.DivRoundUp(data.width, 8), HDUtils.DivRoundUp(data.height, 8), data.viewCount);
632622
}
633623
}
634624
});
@@ -649,13 +639,8 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
649639
if (!hdCamera.colorPyramidHistoryIsValid)
650640
{
651641
hdCamera.colorPyramidHistoryIsValid = true; // For the next frame...
652-
hdCamera.colorPyramidHistoryValidFrames = 0;
653642
result = renderGraph.defaultResources.blackTextureXR;
654643
}
655-
else
656-
{
657-
hdCamera.colorPyramidHistoryValidFrames++;
658-
}
659644
}
660645

661646
PushFullScreenDebugTexture(renderGraph, result, transparent ? FullScreenDebugMode.TransparentScreenSpaceReflections : FullScreenDebugMode.ScreenSpaceReflections);

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ internal void InitRayTracingManager()
9696

9797
internal void ReleaseRayTracingManager()
9898
{
99-
m_CurrentRAS.Dispose();
100-
10199
if (m_RayTracingLightCluster != null)
102100
m_RayTracingLightCluster.ReleaseResources();
103101
if (m_RayCountManager != null)

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandl
9696
propertyBlock.SetTexture(HDShaderIDs._Source, source);
9797
propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias);
9898
SetSourceSize(propertyBlock, source);
99-
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, downSamplePassIndex, MeshTopology.Triangles, 3, 1, propertyBlock);
99+
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, downSamplePassIndex, MeshTopology.Quads, 4, 1, propertyBlock);
100100
}
101101
}
102102

@@ -137,7 +137,7 @@ public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle dest
137137
propertyBlock.SetTexture(HDShaderIDs._Source, source);
138138
propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias);
139139
SetSourceSize(propertyBlock, source);
140-
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, copyPassIndex, MeshTopology.Triangles, 3, 1, propertyBlock);
140+
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, copyPassIndex, MeshTopology.Quads, 4, 1, propertyBlock);
141141
}
142142
}
143143

@@ -183,7 +183,7 @@ public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle sourc
183183
propertyBlock.SetFloat(HDShaderIDs._SampleCount, sampleCount);
184184
propertyBlock.SetFloat(HDShaderIDs._Radius, radius);
185185
SetSourceSize(propertyBlock, source);
186-
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, verticalBlurPassIndex, MeshTopology.Triangles, 3, 1, propertyBlock);
186+
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, verticalBlurPassIndex, MeshTopology.Quads, 4, 1, propertyBlock);
187187
}
188188
}
189189

@@ -229,7 +229,7 @@ public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle sou
229229
propertyBlock.SetFloat(HDShaderIDs._SampleCount, sampleCount);
230230
propertyBlock.SetFloat(HDShaderIDs._Radius, radius);
231231
SetSourceSize(propertyBlock, source);
232-
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, horizontalBlurPassIndex, MeshTopology.Triangles, 3, 1, propertyBlock);
232+
ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, horizontalBlurPassIndex, MeshTopology.Quads, 4, 1, propertyBlock);
233233
}
234234
}
235235

0 commit comments

Comments
 (0)