Merge pull request #17464 from smoogipoo/fix-logo-thread-safety

Fix LogoVisualisation draw thread safety
This commit is contained in:
Dean Herbert 2022-03-27 09:50:42 +09:00 committed by GitHub
commit 1edf1d8f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,7 @@ namespace osu.Game.Screens.Menu
private static readonly Color4 transparent_white = Color4.White.Opacity(0.2f);
private float[] audioData;
private readonly float[] audioData = new float[256];
private readonly QuadBatch<TexturedVertex2D> vertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
@ -192,7 +192,8 @@ namespace osu.Game.Screens.Menu
shader = Source.shader;
texture = Source.texture;
size = Source.DrawSize.X;
audioData = Source.frequencyAmplitudes;
Source.frequencyAmplitudes.AsSpan().CopyTo(audioData);
}
public override void Draw(Action<TexturedVertex2D> vertexAction)