浏览代码

Log time elapsed when compiling shaders

/main
Peter Bay Bastian 7 年前
当前提交
66129542
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;

using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
using UnityEngine.Rendering;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace UnityEditor.ShaderGraph.Drawing

try
{
var sw = new Stopwatch();
sw.Start();
var i = 0;
EditorUtility.DisplayProgressBar("Shader Graph", string.Format("Compiling preview shaders ({0}/{1})", i, count), 0f);
foreach (var node in masterNodes)

i++;
EditorUtility.DisplayProgressBar("Shader Graph", string.Format("Compiling preview shaders ({0}/{1})", i, count), 0f);
}
sw.Stop();
Debug.LogFormat("Compiled preview shaders in {0} seconds", sw.Elapsed.TotalSeconds);
}
finally
{

}
m_PreviewProperties.Clear();
}
foreach (var nodeGuid in m_DirtyPreviews)
{

正在加载...
取消
保存