private VisualElement CreateProgramElement(string name, ShaderProgramPerfInfo perfInfo) { var fold = new Foldout(); fold.text = name; VisualElement ve = null; if (perfInfo != null) { ve = ShaderProgramInfoElement.Create(perfInfo); } else { ve = new Label("No data"); } ve.style.marginLeft = FoldMarginLeft; fold.Add(ve); fold.style.marginLeft = FoldMarginLeft; return(fold); }
private VisualElement InitShaderProgramElement(string name, ShaderProgramPerfInfo info) { Foldout fold = new Foldout(); fold.name = name; fold.text = name; var ve = ShaderProgramInfoElement.Create(info); ve.style.marginLeft = 20; var cycleInfo = ve.Q <Foldout>("CycleInfo"); var mainInfo = ve.Q <Foldout>("MainInfo"); var shaderInfo = ve.Q <Foldout>("ShaderInfo"); // InitFold InitShaderInfoFoldout(fold, name, true); InitShaderInfoFoldout(cycleInfo, name + "-Cycle", true); InitShaderInfoFoldout(mainInfo, name + "-Main", false); InitShaderInfoFoldout(shaderInfo, name + "-Shader", false); fold.Add(ve); return(fold); }
private void OnEnable() { this.rootVisualElement.Add(ShaderProgramInfoElement.Create(null)); }