コード例 #1
0
 protected AsyncBuildReportJob(ShaderAnalysisReport args)
 {
     target         = args.targetPlatform;
     filter         = args.filter ?? new ShaderProgramFilter();
     features       = args.features;
     logCommandLine = args.logCommandLines;
 }
コード例 #2
0
        void OnGUI_BuildReportToolbar(List <GUIAction> actions, Func <IAsyncJob> buildReportJob, Object asset, PlatformJob capability)
        {
            if (m_AssetMetadata == null)
            {
                return;
            }

            var assetGUID = ShaderAnalysisUtils.CalculateGUIDFor(asset);
            var report    = m_AssetMetadata.GetReport(assetGUID);

            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                EditorGUILayout.LabelField("Reporting", EditorStyles.whiteLargeLabel, GUILayout.Width(75));

                GUI.enabled = EditorShaderTools.DoesPlatformSupport(m_CurrentPlatform, capability);
                if (GUILayout.Button(EditorGUIUtility.TrIconContent("PlayButton On", "Build Report"), EditorStyles.toolbarButton, GUILayout.Width(k_IconSize)))
                {
                    actions.Add(new GUIAction(GUIActionKind.BuildReportJob, buildReportJob, asset));
                }
                m_BuildReportFeature = (BuildReportFeature)EditorGUILayout.EnumFlagsField(m_BuildReportFeature, GUILayout.Width(80));

                GUILayout.Space(k_HorizontalSpacing);

                var genDir = ShaderAnalysisUtils.GetTemporaryDirectory(asset, m_CurrentPlatform);
                GUI.enabled = genDir.Exists;
                if (GUILayout.Button(EditorGUIUtility.TrIconContent("Project", "Open Temp Dir"), EditorStyles.toolbarButton, GUILayout.Width(k_IconSize)))
                {
                    Application.OpenURL(genDir.FullName);
                }

                GUILayout.Space(k_HorizontalSpacing);

                GUI.enabled = report != null && ExporterUtilities.IsValid(m_ReportExporterIndex);
                if (GUILayout.Button(EditorGUIUtility.TrIconContent("SceneLoadOut", "Export to"), EditorStyles.toolbarButton, GUILayout.Width(k_IconSize)))
                {
                    actions.Add(new GUIAction(GUIActionKind.ExportReport, asset));
                }
                GUI.enabled           = true;
                m_ReportExporterIndex =
                    (ReportExporterIndex)EditorGUILayout.Popup((int)m_ReportExporterIndex,
                                                               ExporterUtilities.ReportExporterNames, GUILayout.Width(k_ExporterSize));
            }
            GUILayout.EndHorizontal();
            GUI.enabled = true;
        }
コード例 #3
0
 public static ShaderAnalysisReport <TAsset> New <TAsset>(
     TAsset asset,
     BuildTarget currentPlatform,
     ShaderProgramFilter filter  = null,
     BuildReportFeature features = (BuildReportFeature)(-1),
     bool logCommandLines        = false
     )
 => new ShaderAnalysisReport <TAsset>
 {
     asset  = asset,
     common = new ShaderAnalysisReport
     {
         targetPlatform  = currentPlatform,
         filter          = filter,
         features        = features,
         logCommandLines = logCommandLines
     }
 };