Material Clustering Benchmark
RSnumKM.cs
Go to the documentation of this file.
1using UnityEngine;
3
5{
7 {
8 private const int textureSize = 64;
9
10 public RSnumKM(
11 int kernelSize,
12 UnityEngine.Video.VideoClip[] videos,
13 ComputeShader csHighlightRemoval
15
17 {
18 var workList = new BenchmarkDescription(
19 ClusteringTest.LogType.Variance,
20 "Random swap (1KM) vs Random swap (2KM)"
21 );
22
23 foreach (UnityEngine.Video.VideoClip video in this.videos)
24 {
25 for (int numIterations = 1; numIterations < 31; numIterations++)
26 {
27 foreach (int numIterationsKM in new int[] { 1, 2, 3 })
28 {
29 AddRs(
30 workList: workList,
31 video: video,
32 numIterations: numIterations,
34 numIterationsKM: numIterationsKM
35 );
36 }
37 }
38 }
39
40 return workList;
41 }
42
43 private static void AddRs(
44 BenchmarkDescription workList,
45 UnityEngine.Video.VideoClip video,
46 int numIterations,
47 ComputeShader csHighlightRemoval,
48 int numIterationsKM
49 )
50 {
51 if (
53 iterations: numIterations,
54 iterationsKM: numIterationsKM
55 )
56 )
57 {
58 workList.dispatches.Push(
60 staggeredJitter: false,
61 video: video,
62 doDownscale: false,
63 dispatcher: new DispatcherRSfixed(
64 computeShader: csHighlightRemoval,
65 numIterations: numIterations,
66 doRandomizeEmptyClusters: false,
67 useFullResTexRef: false,
68 parameters: new DispatcherRSfixed.Parameters(
69 numIterationsKm: numIterationsKM
70 ),
71 doReadback: false,
72 clusteringRTsAndBuffers: new ClusteringRTsAndBuffers(
73 numClusters: 6,
74 workingSize: textureSize,
76 jitterSize: 1
77 )
78 )
79 )
80 );
81 }
82 }
83 }
84}
readonly UnityEngine.Video.VideoClip[] videos
readonly Stack< LaunchParameters > dispatches
RSnumKM(int kernelSize, UnityEngine.Video.VideoClip[] videos, ComputeShader csHighlightRemoval)
Definition: RSnumKM.cs:10
override BenchmarkDescription GenerateBenchmark()
Definition: RSnumKM.cs:16
Call Allocate before using and Dispose after using.
static bool IsNumIterationsValid(int iterationsKM, int iterations)
const int fullTextureSize