|
|
|
|
|
|
|
|
|
|
private struct SSliceEntry |
|
|
|
{ |
|
|
|
public uint texId; |
|
|
|
public uint countLRU; |
|
|
|
public uint texId; |
|
|
|
public uint countLRU; |
|
|
|
public Hash128 hash; |
|
|
|
}; |
|
|
|
|
|
|
|
private int m_NumTextures; |
|
|
|
|
|
|
return sliceIndex; |
|
|
|
|
|
|
|
var texId = (uint)texture.GetInstanceID(); |
|
|
|
var hash = texture.imageContentsHash; |
|
|
|
|
|
|
|
//assert(TexID!=g_InvalidTexID);
|
|
|
|
if (texId == g_InvalidTexID) return 0; |
|
|
|
|
|
|
if (m_LocatorInSliceArray.TryGetValue(texId, out cachedSlice)) |
|
|
|
{ |
|
|
|
sliceIndex = cachedSlice; |
|
|
|
bFoundAvailOrExistingSlice = true; |
|
|
|
|
|
|
|
bFoundAvailOrExistingSlice = true; |
|
|
|
bSwapSlice = bSwapSlice || (m_SliceArray[sliceIndex].hash != hash); |
|
|
|
} |
|
|
|
|
|
|
|
// If no existing copy found in the array
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_SliceArray[sliceIndex].hash = hash; |
|
|
|
|
|
|
|
if (bSwapSlice) // if this was a miss
|
|
|
|
{ |
|
|
|