浏览代码

Add progress bar during shader compilation

/main
Peter Bay Bastian 7 年前
当前提交
3bcd87d8
共有 1 个文件被更改,包括 21 次插入5 次删除
  1. 26
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewSystem.cs

26
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewSystem.cs


m_LastUpdate = updateTime;
PropagateNodeSet(m_DirtyShaders);
foreach (var nodeGuid in m_DirtyShaders)
if (m_DirtyShaders.Any())
UpdateShader(nodeGuid);
PropagateNodeSet(m_DirtyShaders);
EditorUtility.DisplayProgressBar("Shader Graph", "Compiling preview shaders", 0f);
var count = m_DirtyShaders.Count;
try
{
var i = 0;
foreach (var nodeGuid in m_DirtyShaders)
{
UpdateShader(nodeGuid);
i++;
EditorUtility.DisplayProgressBar("Shader Graph", "Compiling preview shaders", (float)i / count);
}
}
finally
{
EditorUtility.ClearProgressBar();
}
m_DirtyPreviews.UnionWith(m_DirtyShaders);
m_DirtyShaders.Clear();
m_DirtyPreviews.UnionWith(m_DirtyShaders);
m_DirtyShaders.Clear();
m_DirtyPreviews.UnionWith(m_TimeDependentPreviews);
PropagateNodeSet(m_DirtyPreviews);

正在加载...
取消
保存