浏览代码

TextureCache: return invalid slice index instead of throwing null pointer exception when getting queried with a null texture

/Branch_batcher
Joel de Vahl 8 年前
当前提交
b682a01c
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 6
      Assets/ScriptableRenderPipeline/common/TextureCache.cs

6
Assets/ScriptableRenderPipeline/common/TextureCache.cs


public int FetchSlice(Texture texture)
{
var sliceIndex = -1;
if (texture == null)
return sliceIndex;
var texId = (uint)texture.GetInstanceID();
//assert(TexID!=g_InvalidTexID);

var bFoundAvailOrExistingSlice = false;
var sliceIndex = -1;
// search for existing copy
if (m_LocatorInSliceArray.ContainsKey(texId))

正在加载...
取消
保存