private void AppendRenderTargetInfo(JsonStringGenerator jsonStringGenerator, FrameInfoCrawler.FrameDebuggerEventData evtData) { using (new JsonStringGenerator.ObjectScopeWithName(jsonStringGenerator, "renderTarget")) { jsonStringGenerator.AddObjectValue("rtName", evtData.rtName). AddObjectValue("rtWidth", evtData.rtWidth).AddObjectValue("rtHeight", evtData.rtHeight). AddObjectValue("rtCount", evtData.rtCount).AddObjectValue("rtHasDepthTexture", evtData.rtHasDepthTexture); } }
private void AppendFrameEvent(JsonStringGenerator jsonStringGenerator, FrameInfoCrawler.FrameDebuggerEvent evt, FrameInfoCrawler.FrameDebuggerEventData evtData) { using (new JsonStringGenerator.ObjectScope(jsonStringGenerator)) { jsonStringGenerator.AddObjectValue("frameEventIndex", evtData.frameEventIndex); jsonStringGenerator.AddObjectValue("type", evt.type.ToString()); AppendSavedTextureInfo(jsonStringGenerator, "screenshot", evtData.savedScreenShotInfo); AppendRenderingInfo(jsonStringGenerator, evt, evtData); AppendRenderTargetInfo(jsonStringGenerator, evtData); AppendShaderInfo(jsonStringGenerator, evtData); } }
private void AppendShaderInfo(JsonStringGenerator jsonStringGenerator, FrameInfoCrawler.FrameDebuggerEventData evtData) { using (new JsonStringGenerator.ObjectScopeWithName(jsonStringGenerator, "shaderInfo")) { jsonStringGenerator.AddObjectValue("shaderName", evtData.shaderName); jsonStringGenerator.AddObjectValue("subShaderIndex", evtData.subShaderIndex); jsonStringGenerator.AddObjectValue("shaderPassIndex", evtData.shaderPassIndex); jsonStringGenerator.AddObjectValue("passName", evtData.passName); jsonStringGenerator.AddObjectValue("passLightMode", evtData.passLightMode); jsonStringGenerator.AddObjectValue("shaderKeywords", evtData.shaderKeywords); AppendShaderParam(jsonStringGenerator, evtData.convertedProperties); } }
public static RenderTexture GetTargetRenderTexture(FrameInfoCrawler.FrameDebuggerEventData info) { RenderTexture target = null; var renderTextures = Resources.FindObjectsOfTypeAll <RenderTexture>(); foreach (var rt in renderTextures) { if (rt.width == info.rtWidth && rt.height == info.rtHeight && rt.name == info.rtName) { if (target != null) { Debug.LogWarning("Already find renderTarget. " + info.rtName); } target = rt; } } return(target); }
private void AppendRenderingInfo(JsonStringGenerator jsonStringGenerator, FrameInfoCrawler.FrameDebuggerEvent evt, FrameInfoCrawler.FrameDebuggerEventData evtData) { using (new JsonStringGenerator.ObjectScopeWithName(jsonStringGenerator, "rendering")) { jsonStringGenerator.AddObjectValue("vertexCount", evtData.vertexCount). AddObjectValue("indexCount", evtData.indexCount). AddObjectValue("instanceCount", evtData.instanceCount). AddObjectValue("drawCallCount", evtData.drawCallCount). AddObjectValue("componentInstanceID", evtData.componentInstanceID). AddObjectValue("meshInstanceID", evtData.meshInstanceID). AddObjectValue("meshSubset", evtData.meshSubset). AddObjectValue("batchBreakCauseStr", evtData.batchBreakCauseStr); if (evt.gameObject) { stringBuilder.Length = 0; GetGameObjectName(evt.gameObject, stringBuilder); jsonStringGenerator.AddObjectValue("gameobject", stringBuilder.ToString()); } } }