From 753c1c877c48527c9a5b4d3f5ecc6608581d0e89 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Sep 2023 23:10:13 +0900 Subject: [PATCH] Revert masking SSBO changes --- .../UI/Cursor/CursorTrail.cs | 20 +++++-------------- .../Resources/Shaders/sh_TestVertex.vs | 2 +- osu.Game/Screens/Loader.cs | 5 ++++- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 0774d34488..a29faac5a0 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -286,7 +286,7 @@ public override void Draw(IRenderer renderer) if (time - part.Time >= 1) continue; - vertexBatch.Add(new TexturedTrailVertex(renderer) + vertexBatch.Add(new TexturedTrailVertex { Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y + size.Y * (1 - originPosition.Y)), TexturePosition = textureRect.BottomLeft, @@ -295,7 +295,7 @@ public override void Draw(IRenderer renderer) Time = part.Time }); - vertexBatch.Add(new TexturedTrailVertex(renderer) + vertexBatch.Add(new TexturedTrailVertex { Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y + size.Y * (1 - originPosition.Y)), TexturePosition = textureRect.BottomRight, @@ -304,7 +304,7 @@ public override void Draw(IRenderer renderer) Time = part.Time }); - vertexBatch.Add(new TexturedTrailVertex(renderer) + vertexBatch.Add(new TexturedTrailVertex { Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y - size.Y * originPosition.Y), TexturePosition = textureRect.TopRight, @@ -313,7 +313,7 @@ public override void Draw(IRenderer renderer) Time = part.Time }); - vertexBatch.Add(new TexturedTrailVertex(renderer) + vertexBatch.Add(new TexturedTrailVertex { Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y - size.Y * originPosition.Y), TexturePosition = textureRect.TopLeft, @@ -362,22 +362,12 @@ public struct TexturedTrailVertex : IEquatable, IVertex [VertexMember(1, VertexAttribPointerType.Float)] public float Time; - [VertexMember(1, VertexAttribPointerType.Int)] - private readonly int maskingIndex; - - public TexturedTrailVertex(IRenderer renderer) - { - this = default; - maskingIndex = renderer.CurrentMaskingIndex; - } - public bool Equals(TexturedTrailVertex other) { return Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour) - && Time.Equals(other.Time) - && maskingIndex == other.maskingIndex; + && Time.Equals(other.Time); } } } diff --git a/osu.Game.Tests/Resources/Shaders/sh_TestVertex.vs b/osu.Game.Tests/Resources/Shaders/sh_TestVertex.vs index 80ed686ba5..505554bb33 100644 --- a/osu.Game.Tests/Resources/Shaders/sh_TestVertex.vs +++ b/osu.Game.Tests/Resources/Shaders/sh_TestVertex.vs @@ -13,7 +13,7 @@ layout(location = 4) out mediump vec2 v_BlendRange; void main(void) { // Transform from screen space to masking space. - highp vec3 maskingPos = g_MaskingInfo.ToMaskingSpace * vec3(m_Position, 1.0); + highp vec3 maskingPos = g_ToMaskingSpace * vec3(m_Position, 1.0); v_MaskingPosition = maskingPos.xy / maskingPos.z; v_Colour = m_Colour; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 962c7d9d14..372cfe748e 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -126,9 +126,12 @@ public partial class ShaderPrecompiler : Drawable private void load(ShaderManager manager) { loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE)); - loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2_NO_MASKING, FragmentShaderDescriptor.BLUR)); + loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.BLUR)); + loadTargets.Add(manager.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE)); + loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, "TriangleBorder")); + loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE)); }