浏览代码

Merge pull request #1341 from Unity-Technologies/Fix-issue-with-framesettings-and-debug-windows

Fix issue with framesettings on HDRP Asset and debug windows
/main
GitHub 7 年前
当前提交
eeb59394
共有 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())

正在加载...
取消
保存