浏览代码

Fixed PreIntegratedFGD texture being destroyed in some cases and not re-rendered correctly (also removed some redundant tests in Lit.cs and StackLit.cs)

/main
Julien Ignace 6 年前
当前提交
f339f7c5
共有 3 个文件被更改,包括 3 次插入23 次删除
  1. 11
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
  2. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
  3. 11
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs

11
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs


// Init precomputed texture
//-----------------------------------------------------------------------------
bool m_isInit;
public Lit() {}
public override void Build(HDRenderPipelineAsset hdAsset)

m_isInit = false;
}
public override void Cleanup()

m_isInit = false;
if (m_isInit)
return;
m_isInit = true;
}
public override void Bind()

4
com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs


public void RenderInit(FGDIndex index, CommandBuffer cmd)
{
if (m_isInit[(int)index])
// Here we have to test IsCreated because in some circumstances (like loading RenderDoc), the texture is internally destroyed but we don't know from C# side.
// In this case IsCreated will return false, allowing us to re-render the texture (setting the texture as current RT during DrawFullScreen will automatically re-create it internally)
if (m_isInit[(int)index] && m_PreIntegratedFGD[(int)index].IsCreated())
return;
using (new ProfilingSample(cmd, "PreIntegratedFGD Material Generation"))

11
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs


// Init precomputed textures
//-----------------------------------------------------------------------------
bool m_isInit;
public StackLit() {}
public override void Build(HDRenderPipelineAsset hdAsset)

m_isInit = false;
}
public override void Cleanup()

m_isInit = false;
if (m_isInit)
return;
m_isInit = true;
}
public override void Bind()

正在加载...
取消
保存