浏览代码

Changed CachedEntry type from struct to class to avoid unnecessary copies when doing array operations.

Replaced unnecessary array copy in VectorArray class.
/RenderPassXR_Sandbox
uygar 8 年前
当前提交
05ca6220
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 2
      Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs
  2. 5
      Assets/ScriptableRenderPipeline/Core/Shadow/VectorArray.cs

2
Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs


public bool IsValid() { return viewport.width > 0 && viewport.height > 0; }
}
protected struct CachedEntry : IComparable<CachedEntry>
protected class CachedEntry : IComparable<CachedEntry>
{
public Key key;
public Data current;

5
Assets/ScriptableRenderPipeline/Core/Shadow/VectorArray.cs


{
for (idx = 0; idx < m_count; ++idx)
{
T obj = this[idx];
if (compareDelegate(ref designator, ref obj))
if (compareDelegate(ref designator, ref m_array[m_offset + idx]))
return true;
}
idx = k_InvalidIdx;

{
for (idx = 0; idx < m_count; ++idx)
{
if (this[idx].Equals(designator))
if (m_array[m_offset + idx].Equals(designator))
return true;
}
idx = k_InvalidIdx;

正在加载...
取消
保存