From 3577b5b87558d08a82369cb42562414dd3f1a4d2 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Wed, 15 Jul 2020 15:39:48 +0200 Subject: [PATCH] Remove MSAA debug mode when renderpipeline asset has no MSAA --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 9 ++++++--- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f65a221d12d..64653b48d10 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -731,6 +731,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed path-traced subsurface scattering mixing with diffuse and specular BRDFs (1250601). - Fixed custom pass re-ordering issues. - Improved robustness of normal mapping when scale is 0, and mapping is extreme (normals in or below the tangent plane). +- Remove MSAA debug mode when renderpipeline asset has no MSAA ### Changed - Improve MIP selection for decals on Transparents diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index a3649d89d95..864dd1fcae2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1550,10 +1550,13 @@ void RegisterRenderingDebug() }); } - widgetList.AddRange(new DebugUI.Widget[] + if (HDRenderPipeline.currentAsset?.currentPlatformRenderPipelineSettings.supportMSAA ?? true) { - new DebugUI.EnumField { displayName = "MSAA Samples", getter = () => (int)data.msaaSamples, setter = value => data.msaaSamples = (MSAASamples)value, enumNames = s_MsaaSamplesDebugStrings, enumValues = s_MsaaSamplesDebugValues, getIndex = () => data.msaaSampleDebugModeEnumIndex, setIndex = value => data.msaaSampleDebugModeEnumIndex = value }, - }); + widgetList.AddRange(new DebugUI.Widget[] + { + new DebugUI.EnumField { displayName = "MSAA Samples", getter = () => (int)data.msaaSamples, setter = value => data.msaaSamples = (MSAASamples)value, enumNames = s_MsaaSamplesDebugStrings, enumValues = s_MsaaSamplesDebugValues, getIndex = () => data.msaaSampleDebugModeEnumIndex, setIndex = value => data.msaaSampleDebugModeEnumIndex = value }, + }); + } widgetList.AddRange(new DebugUI.Widget[] { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index fc95a564c36..e50b3ae0f33 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -537,9 +537,6 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau // TODO : Bind this directly to the debug menu instead of having an intermediate value m_MSAASamples = m_Asset ? m_Asset.currentPlatformRenderPipelineSettings.msaaSampleCount : MSAASamples.None; - // Propagate it to the debug menu - m_DebugDisplaySettings.data.msaaSamples = m_MSAASamples; - #if ENABLE_VIRTUALTEXTURES // Debug.Log("Scriptable renderpipeline VT enabled"); m_MRTTransparentMotionVec = new RenderTargetIdentifier[2 + VTBufferManager.AdditionalForwardRT]; @@ -2285,7 +2282,10 @@ AOVRequestData aovRequest else { // Make sure we are in sync with the debug menu for the msaa count - m_MSAASamples = m_DebugDisplaySettings.data.msaaSamples; + m_MSAASamples = (m_DebugDisplaySettings.data.msaaSamples != MSAASamples.None) ? + m_DebugDisplaySettings.data.msaaSamples : + m_Asset.currentPlatformRenderPipelineSettings.msaaSampleCount; + m_SharedRTManager.SetNumMSAASamples(m_MSAASamples); m_DebugDisplaySettings.UpdateCameraFreezeOptions();