Material Clustering Benchmark
EmptyClusterRandomization.cs
Go to the documentation of this file.
1using UnityEngine;
3
5{
7 {
9 int kernelSize,
10 UnityEngine.Video.VideoClip[] videos,
11 ComputeShader csHighlightRemoval
13
15 {
16 var workList = new BenchmarkDescription(
17 ClusteringTest.LogType.Variance,
18 "Empty cluster randomization (KM)"
19 );
20
21 foreach (UnityEngine.Video.VideoClip video in this.videos)
22 {
23 /*
24 ! lowest textureSize must be no less, than kernel size
25 */
26 for (int textureSize = 64; textureSize >= 8; textureSize /= 2)
27 {
28 foreach (bool doRandomizeEmptyClusters in new bool[] { true, false })
29 {
30 workList.dispatches.Push(
32 staggeredJitter: false,
33 video: video,
34 doDownscale: false,
35 dispatcher: new DispatcherKM(
36 computeShader: this.csHighlightRemoval,
37 numIterations: 3,
38 doRandomizeEmptyClusters: doRandomizeEmptyClusters,
39 useFullResTexRef: false,
40 clusteringRTsAndBuffers: new ClusteringRTsAndBuffers(
41 numClusters: 32,
42 workingSize: textureSize,
44 jitterSize: 1
45 )
46 )
47 )
48 );
49 }
50 }
51 }
52
53 return workList;
54 }
55 }
56}
readonly UnityEngine.Video.VideoClip[] videos
EmptyClusterRandomization(int kernelSize, UnityEngine.Video.VideoClip[] videos, ComputeShader csHighlightRemoval)
Call Allocate before using and Dispose after using.
const int fullTextureSize