public void FreeNative(EntityManager man, Entity e, ref Image2DSTB imgSTB)
        {
#if ENABLE_DOTSRUNTIME_PROFILER
            int w = 0, h = 0;
            unsafe
            {
                ImageIOSTBNativeCalls.GetImageFromHandle(imgSTB.imageHandle, ref w, ref h);
            }
            if (w != 0 && h != 0)
            {
                ProfilerStats.AccumStats.memTextureCount.Accumulate(-1);

                long bytes = -w * h * 4;

                ProfilerStats.AccumStats.memTexture.Accumulate(bytes);
                ProfilerStats.AccumStats.memReservedGFX.Accumulate(bytes);
                ProfilerStats.AccumStats.memUsedGFX.Accumulate(bytes);
            }
#endif
            ImageIOSTBNativeCalls.FreeNative(imgSTB.imageHandle);
        }
Example #2
0
 public void FreeNative(EntityManager man, Entity e, ref Image2DSTB imgSTB)
 {
     ImageIOSTBNativeCalls.FreeNative(imgSTB.imageHandle);
 }