浏览代码

semi-temporary hack to reload .compute assets

/main
vlad-andreev 8 年前
当前提交
b145a4d1
共有 5 个文件被更改,包括 34 次插入5 次删除
  1. 2
      Assets/ScriptableRenderLoop/ForwardRenderLoop/ForwardRenderLoop.cs
  2. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  3. 1
      Assets/ScriptableRenderLoop/ScriptableRenderLoop.cs
  4. 32
      Assets/ScriptableRenderLoop/ScriptableRenderLoopPicker.cs
  5. 2
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

2
Assets/ScriptableRenderLoop/ForwardRenderLoop/ForwardRenderLoop.cs


Rebuild ();
}
void Rebuild()
public override void Rebuild()
{
m_ShadowPass = new ShadowRenderPass (m_ShadowSettings);
}

2
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


s_punctualLightList.Release();
}
void Rebuild()
public override void Rebuild()
{
ClearComputeBuffers();

1
Assets/ScriptableRenderLoop/ScriptableRenderLoop.cs


public abstract class ScriptableRenderLoop : ScriptableObject
{
public abstract void Render(Camera[] cameras, RenderLoop renderLoop);
public virtual void Rebuild() { }
#if UNITY_EDITOR
public virtual UnityEditor.SupportedRenderingFeatures GetSupportedRenderingFeatures() { return new UnityEditor.SupportedRenderingFeatures(); }

32
Assets/ScriptableRenderLoop/ScriptableRenderLoopPicker.cs


if (m_RenderLoop == null)
return false;
#if UNITY_EDITOR
if (m_AssetVersion != ms_GlobalAssetVersion)
{
m_AssetVersion = ms_GlobalAssetVersion;
m_RenderLoop.Rebuild();
}
#endif
}
}
#if UNITY_EDITOR
// Temporary hack to allow compute shader reloading
internal class AssetReloader : UnityEditor.AssetPostprocessor
{
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
foreach (string str in importedAssets)
{
if (str.EndsWith(".compute"))
{
ms_GlobalAssetVersion++;
break;
}
}
}
}
public static int ms_GlobalAssetVersion = 0;
public int m_AssetVersion = 0;
#endif
}
}

2
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


}
void Rebuild()
public override void Rebuild()
{
ClearComputeBuffers();

正在加载...
取消
保存