浏览代码

Implement a small optimization of the texture cache

/stochastic_alpha_test
Evgenii Golubev 7 年前
当前提交
24906cf6
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 5
      ScriptableRenderPipeline/Core/TextureCache.cs
  2. 1
      TestbedPipelines/Fptl/FptlLighting.cs

5
ScriptableRenderPipeline/Core/TextureCache.cs


var bFoundAvailOrExistingSlice = false;
// search for existing copy
if (m_LocatorInSliceArray.ContainsKey(texId))
int cachedSlice;
if (m_LocatorInSliceArray.TryGetValue(texId, out cachedSlice))
sliceIndex = m_LocatorInSliceArray[texId];
sliceIndex = cachedSlice;
bFoundAvailOrExistingSlice = true;
Debug.Assert(m_SliceArray[sliceIndex].texId == texId);
}

1
TestbedPipelines/Fptl/FptlLighting.cs


var lightData = new SFiniteLightData[numVolumes];
var boundData = new SFiniteLightBound[numVolumes];
var worldToView = WorldToCamera(camera);
bool isNegDeterminant = Vector3.Dot(worldToView.GetColumn(0), Vector3.Cross(worldToView.GetColumn(1), worldToView.GetColumn(2))) < 0.0f; // 3x3 Determinant.
uint shadowLightIndex = 0;
foreach (var cl in inputs.visibleLights)

正在加载...
取消
保存