浏览代码

Fix issue with framesettings on HDRP Asset and debug windows

When the debug windows is open, the HDRP Asset runtime framesetting are
overwritten by the debug windows settings, whereas it is the debug
windows that should update itself.
/main
sebastienlagarde 6 年前
当前提交
96ce456b
共有 3 个文件被更改,包括 27 次插入0 次删除
  1. 5
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs
  2. 17
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs
  3. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

5
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs


public sealed partial class DebugManager
{
#if UNITY_EDITOR
// HACK: Make debug windows work correctly with FrameSettings in Editor
public static bool renderPipelineIsRecreated = false;
#endif
static readonly DebugManager s_Instance = new DebugManager();
public static DebugManager instance { get { return s_Instance; } }

17
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs


DebugManager.instance.onSetDirty -= MarkDirty;
Undo.ClearUndo(m_Settings);
DestroyWidgetStates();
}
public void DestroyWidgetStates()
{
if (m_WidgetStates != null)
{
// Clear all the states from memory

void Update()
{
// HACK: Make debug windows work correctly with FrameSettings in Editor
// When we manipulate the framesettings on HDRenderPipelineAsset, the debug windows is not
// refresh, it keep the old state of the runtime framesettings in memory and thus overwrite
// our freshly edited value. To ensure debug windows is aware of framesettings change we need to
// destroy its internal widget state.
if (DebugManager.renderPipelineIsRecreated)
{
DestroyWidgetStates();
DebugManager.renderPipelineIsRecreated = false;
}
// END HACK
int treeState = DebugManager.instance.GetState();
if (m_DebugTreeState != treeState || m_IsDirty)

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


public HDRenderPipeline(HDRenderPipelineAsset asset)
{
#if UNITY_EDITOR
// HACK: Make debug windows work correctly with FrameSettings in Editor
DebugManager.renderPipelineIsRecreated = true;
#endif
m_ValidAPI = true;
if (!SetRenderingFeatures())

正在加载...
取消
保存