3using System.Collections.Generic;
8 private List<WorkOption> workOptions;
9 private WorkOption frameTimeWorkOption;
11 public UnityEngine.Video.VideoClip[]
videos;
16 private class WorkOption
24 this.workList = workList;
28 private GUIStyle guiStyle;
30 private void InitGuiStyle()
33 Texture2D guiBackgroundTex =
new Texture2D(size, size);
34 Color[] colors =
new Color[size * size];
35 for (
int i = 0; i < size * size; i++)
37 colors[i] = Color.black;
39 guiBackgroundTex.SetPixels(colors);
40 guiBackgroundTex.Apply();
42 this.guiStyle =
new GUIStyle();
43 guiStyle.normal.background = guiBackgroundTex;
48 Assert(this.
videos.Length != 0,
"No video files provided.");
49 foreach (UnityEngine.Video.VideoClip video in
this.videos)
52 video.width == video.height,
53 $
"Video file {video.name} does not have height equal to width. This is unsuppoted to simplify implementation."
57 $
"Video file {video.name} has smaller resolution than required. File resolution: {video.width}; required: {ClusteringTest.fullTextureSize}."
61 System.Diagnostics.Stopwatch.IsHighResolution,
62 "High resolution timer not available."
67 this.workOptions =
new List<WorkOption>();
69 this.frameTimeWorkOption =
new WorkOption(
77 this.workOptions.Add(this.frameTimeWorkOption);
109 this.workOptions.Add(
119 this.workOptions.Add(
129 this.workOptions.Add(
139 this.workOptions.Add(
149 this.workOptions.Add(
160 private static void GuiLine()
162 GUILayout.Label(
"-----------------------------------------");
170 GUILayout.BeginVertical(guiStyle);
172 if (this.clusteringTest.enabled)
174 foreach (WorkOption option
in this.workOptions)
178 GUILayout.Label(
"- " + option.workList.name);
185 $
"Total: {this.clusteringTest.numTotalFinishedDispatches} / {this.clusteringTest.numTotalDispatches}"
188 $
"{this.clusteringTest.currentBenchmark.name}: {this.clusteringTest.numCurBenchmarkFinishedDispatches} / {this.clusteringTest.numCurBenchmarkDispatches}"
190 GUILayout.Label($
"warnings: {this.clusteringTest.warningCounter}");
195 foreach (WorkOption option
in this.workOptions)
197 option.enabled = GUILayout.Toggle(option.enabled, option.workList.name);
200 if (GUILayout.Button(
"Start"))
202 if (System.IO.Directory.Exists(
"Reports") ==
false)
204 System.IO.Directory.CreateDirectory(
"Reports");
207 foreach (WorkOption option
in this.workOptions)
214 this.clusteringTest.enabled =
true;
218 GUILayout.EndVertical();
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
override BenchmarkDescription GenerateBenchmark()
UnityEngine.Video.VideoClip[] videos
ClusteringTest clusteringTest
ComputeShader csHighlightRemoval
const int fullTextureSize
const int kernelSize
Must match the shader.
Stack< BenchmarkDescription > benchmarkStack