|
|
|
|
|
|
{ |
|
|
|
public uint texId; |
|
|
|
public uint countLRU; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#endif
|
|
|
|
}; |
|
|
|
|
|
|
|
private int m_NumTextures; |
|
|
|
|
|
|
return sliceIndex; |
|
|
|
|
|
|
|
var texId = (uint)texture.GetInstanceID(); |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//assert(TexID!=g_InvalidTexID);
|
|
|
|
if (texId == g_InvalidTexID) return 0; |
|
|
|
|
|
|
Debug.Assert(m_SliceArray[sliceIndex].texId == texId); |
|
|
|
|
|
|
|
bFoundAvailOrExistingSlice = true; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
// If no existing copy found in the array
|
|
|
|
|
|
|
if (bFoundAvailOrExistingSlice) |
|
|
|
{ |
|
|
|
m_SliceArray[sliceIndex].countLRU = 0; // mark slice as in use this frame
|
|
|
|
m_SliceArray[sliceIndex].hash = hash; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
m_SliceArray[sliceIndex].hash = hash; |
|
|
|
#endif
|
|
|
|
|
|
|
|
// transfer new slice to sliceIndex from source texture
|
|
|
|
TransferToSlice(sliceIndex, texture); |
|
|
|
} |
|
|
|