@@ -10,12 +10,9 @@ public sealed class WaveformMonitor : Monitor
1010
1111 ComputeBuffer m_Data ;
1212
13- private int threadGroupSize ;
14- private int threadGroupSizeX ;
15- private int threadGroupSizeY ;
16-
17- private string clearKernelName ;
18- private string gatherKernelName ;
13+ private int threadGroupSize ;
14+ private int threadGroupSizeX ;
15+ private int threadGroupSizeY ;
1916
2017 internal override void OnDisable ( )
2118 {
@@ -27,16 +24,16 @@ internal override void OnDisable()
2724 m_Data = null ;
2825 }
2926
30- internal override void OnEnable ( )
31- {
32- base . OnEnable ( ) ;
27+ internal override void OnEnable ( )
28+ {
29+ base . OnEnable ( ) ;
3330
3431 bool isAndroidOpenGL = Application . platform == RuntimePlatform . Android && SystemInfo . graphicsDeviceType != GraphicsDeviceType . Vulkan ;
3532
3633 threadGroupSize = isAndroidOpenGL ? 128 : 256 ;
3734 threadGroupSizeX = isAndroidOpenGL ? 16 : 16 ;
3835 threadGroupSizeY = isAndroidOpenGL ? 8 : 16 ;
39- }
36+ }
4037
4138 internal override bool NeedsHalfRes ( )
4239 {
@@ -78,7 +75,7 @@ internal override void Render(PostProcessRenderContext context)
7875 int kernel = compute . FindKernel ( "KWaveformClear" ) ;
7976 cmd . SetComputeBufferParam ( compute , kernel , "_WaveformBuffer" , m_Data ) ;
8077 cmd . SetComputeVectorParam ( compute , "_Params" , parameters ) ;
81- cmd . DispatchCompute ( compute , kernel , Mathf . CeilToInt ( width / ( float ) threadGroupSizeX ) , Mathf . CeilToInt ( height / ( float ) threadGroupSizeY ) , 1 ) ;
78+ cmd . DispatchCompute ( compute , kernel , Mathf . CeilToInt ( width / ( float ) threadGroupSizeX ) , Mathf . CeilToInt ( height / ( float ) threadGroupSizeY ) , 1 ) ;
8279
8380 // For performance reasons, especially on consoles, we'll just downscale the source
8481 // again to reduce VMEM stalls. Eventually the whole algorithm needs to be rewritten as
@@ -91,7 +88,7 @@ internal override void Render(PostProcessRenderContext context)
9188 cmd . SetComputeBufferParam ( compute , kernel , "_WaveformBuffer" , m_Data ) ;
9289 cmd . SetComputeTextureParam ( compute , kernel , "_Source" , ShaderIDs . WaveformSource ) ;
9390 cmd . SetComputeVectorParam ( compute , "_Params" , parameters ) ;
94- cmd . DispatchCompute ( compute , kernel , width , Mathf . CeilToInt ( height / ( float ) threadGroupSize ) , 1 ) ;
91+ cmd . DispatchCompute ( compute , kernel , width , Mathf . CeilToInt ( height / ( float ) threadGroupSize ) , 1 ) ;
9592 cmd . ReleaseTemporaryRT ( ShaderIDs . WaveformSource ) ;
9693
9794 // Generate the waveform texture
0 commit comments