//实测,在android上,性能分析工具调用本身开心就很大 //public static Profiler.TimeScope ScopeFind = Profiler.TimeScopeManager.GetTimeScope(typeof(GInstancingManager), "PushInstance.Find", Profiler.TimeScope.EProfileFlag.Windows); //public static Profiler.TimeScope ScopePush = Profiler.TimeScopeManager.GetTimeScope(typeof(GInstancingManager), "PushInstance.Push", Profiler.TimeScope.EProfileFlag.Windows); public void PushInstance(GInstancingComponent inst, int lightNum, ref UInt32_4 lightIndices, Graphics.Mesh.CGfxMesh oriMesh, EPoolType poolType) { var meshComp = inst.HostContainer as GMeshComponent; if (meshComp == null) { return; } //ScopeFind.Begin(); if (oriMesh.mInstancePool == null || oriMesh.mShadowInstancePool == null) { oriMesh.mInstancePool = new GInstancing(); Meshes[oriMesh.Name] = oriMesh.mInstancePool; var task = oriMesh.mInstancePool.Init(oriMesh.Name, false); oriMesh.mShadowInstancePool = new GInstancing(); ShadowMeshes[oriMesh.Name] = oriMesh.mShadowInstancePool; var task1 = oriMesh.mShadowInstancePool.Init(oriMesh.Name, true); } GInstancing instType = null; switch (poolType) { case EPoolType.Normal: instType = oriMesh.mInstancePool; break; case EPoolType.Shadow: instType = oriMesh.mShadowInstancePool; break; } //ScopeFind.End(); //ScopePush.Begin(); instType.PushInstance(ref meshComp.Placement.mDrawPosition, ref meshComp.Placement.mDrawScale, ref meshComp.Placement.mDrawRotation, ref lightIndices, lightNum); //ScopePush.End(); }
public void SetShadowHost(GInstancing host) { mShadowHost = host; }
public void SetHost(GInstancing host) { mHost = host; }