1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:02:54 +08:00

Merge pull request #22880 from frenzibyte/fix-ubo-not-bound

Update UBO usages inline with framework changes
This commit is contained in:
Dean Herbert 2023-03-26 19:31:29 +09:00 committed by GitHub
commit 8ad62c243d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 40 additions and 204 deletions

View File

@ -11,7 +11,7 @@
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.314.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.326.0" />
</ItemGroup>
<ItemGroup>
<AndroidManifestOverlay Include="$(MSBuildThisFileDirectory)osu.Android\Properties\AndroidManifestOverlay.xml" />

View File

@ -1,17 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Foundation;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Catch.Tests.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuTestBrowser();
}
}

View File

@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Catch.Tests.iOS
{
@ -11,7 +10,7 @@ namespace osu.Game.Rulesets.Catch.Tests.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuTestBrowser());
}
}
}

View File

@ -1,17 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Foundation;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Mania.Tests.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuTestBrowser();
}
}

View File

@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Mania.Tests.iOS
{
@ -11,7 +10,7 @@ namespace osu.Game.Rulesets.Mania.Tests.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuTestBrowser());
}
}
}

View File

@ -1,17 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Foundation;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Osu.Tests.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuTestBrowser();
}
}

View File

@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Osu.Tests.iOS
{
@ -11,7 +10,7 @@ namespace osu.Game.Rulesets.Osu.Tests.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuTestBrowser());
}
}
}

View File

@ -252,13 +252,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
renderer.SetBlend(BlendingParameters.Additive);
renderer.PushLocalMatrix(DrawInfo.Matrix);
TextureShader.Bind();
BindTextureShader(renderer);
texture.Bind();
for (int i = 0; i < points.Count; i++)
drawPointQuad(points[i], textureRect, i + firstVisiblePointIndex);
TextureShader.Unbind();
UnbindTextureShader(renderer);
renderer.PopLocalMatrix();
}

View File

@ -1,17 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Foundation;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Taiko.Tests.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuTestBrowser();
}
}

View File

@ -1,9 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
using osu.Game.Tests;
namespace osu.Game.Rulesets.Taiko.Tests.iOS
{
@ -11,7 +10,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuTestBrowser());
}
}
}

View File

@ -1,16 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Foundation;
using osu.Framework.iOS;
namespace osu.Game.Tests.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuTestBrowser();
}
}

View File

@ -1,9 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
namespace osu.Game.Tests.iOS
{
@ -11,7 +9,7 @@ namespace osu.Game.Tests.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuTestBrowser());
}
}
}

View File

@ -100,8 +100,10 @@ namespace osu.Game.Tests.Visual.Background
private IUniformBuffer<TriangleBorderData>? borderDataBuffer;
public override void Draw(IRenderer renderer)
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
base.BindUniformResources(shader, renderer);
borderDataBuffer ??= renderer.CreateUniformBuffer<TriangleBorderData>();
borderDataBuffer.Data = borderDataBuffer.Data with
{
@ -109,9 +111,7 @@ namespace osu.Game.Tests.Visual.Background
TexelSize = texelSize
};
TextureShader.BindUniformBlock("m_BorderData", borderDataBuffer);
base.Draw(renderer);
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
}
protected override bool CanDrawOpaqueInterior => false;

View File

@ -306,7 +306,7 @@ namespace osu.Game.Graphics.Backgrounds
};
shader.Bind();
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
shader.BindUniformBlock(@"m_BorderData", borderDataBuffer);
foreach (TriangleParticle particle in parts)
{

View File

@ -249,7 +249,7 @@ namespace osu.Game.Graphics.Backgrounds
};
shader.Bind();
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
shader.BindUniformBlock(@"m_BorderData", borderDataBuffer);
Vector2 relativeSize = Vector2.Divide(triangleSize, size);

View File

@ -76,17 +76,24 @@ namespace osu.Game.Graphics.Sprites
private IUniformBuffer<AnimationData> animationDataBuffer;
private IVertexBatch<LogoAnimationVertex> animationVertexBatch;
protected override void Blit(IRenderer renderer)
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
if (DrawRectangle.Width == 0 || DrawRectangle.Height == 0)
return;
base.BindUniformResources(shader, renderer);
animationDataBuffer ??= renderer.CreateUniformBuffer<AnimationData>();
animationVertexBatch ??= renderer.CreateQuadBatch<LogoAnimationVertex>(1, 2);
animationDataBuffer.Data = animationDataBuffer.Data with { Progress = progress };
TextureShader.BindUniformBlock("m_AnimationData", animationDataBuffer);
shader.BindUniformBlock(@"m_AnimationData", animationDataBuffer);
}
protected override void Blit(IRenderer renderer)
{
if (DrawRectangle.Width == 0 || DrawRectangle.Height == 0)
return;
base.Blit(renderer);
renderer.DrawQuad(
Texture,

View File

@ -273,7 +273,7 @@ namespace osu.Game.Rulesets.Mods
};
shader.Bind();
shader.BindUniformBlock("m_FlashlightParameters", flashlightParametersBuffer);
shader.BindUniformBlock(@"m_FlashlightParameters", flashlightParametersBuffer);
renderer.DrawQuad(renderer.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: addAction);

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.20.0" />
<PackageReference Include="ppy.osu.Framework" Version="2023.314.0" />
<PackageReference Include="ppy.osu.Framework" Version="2023.326.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.320.0" />
<PackageReference Include="Sentry" Version="3.28.1" />
<PackageReference Include="SharpCompress" Version="0.32.2" />

View File

@ -16,6 +16,6 @@
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.314.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.326.0" />
</ItemGroup>
</Project>

View File

@ -1,29 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Threading.Tasks;
using Foundation;
using osu.Framework.iOS;
using UIKit;
namespace osu.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
private OsuGameIOS game;
protected override Framework.Game CreateGame() => game = new OsuGameIOS();
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
if (url.IsFileUrl)
Task.Run(() => game.Import(url.Path));
else
Task.Run(() => game.HandleLink(url.AbsoluteString));
return true;
}
}
}

View File

@ -1,9 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using UIKit;
using osu.Framework.iOS;
namespace osu.iOS
{
@ -11,7 +9,7 @@ namespace osu.iOS
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
GameApplication.Main(new OsuGameIOS());
}
}
}

View File

@ -1,36 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Localisation;
using osu.Game.Overlays.Settings;
namespace osu.iOS
{
public partial class IOSMouseSettings : SettingsSubsection
{
protected override LocalisableString Header => MouseSettingsStrings.Mouse;
[BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig)
{
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = MouseSettingsStrings.DisableMouseWheelVolumeAdjust,
TooltipText = MouseSettingsStrings.DisableMouseWheelVolumeAdjustTooltip,
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel),
},
new SettingsCheckbox
{
LabelText = MouseSettingsStrings.DisableMouseButtons,
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons),
},
};
}
}
}

View File

@ -7,10 +7,7 @@ using System;
using Foundation;
using Microsoft.Maui.Devices;
using osu.Framework.Graphics;
using osu.Framework.Input.Handlers;
using osu.Framework.iOS.Input;
using osu.Game;
using osu.Game.Overlays.Settings;
using osu.Game.Updater;
using osu.Game.Utils;
@ -29,18 +26,6 @@ namespace osu.iOS
// Because we have the home indicator (mostly) hidden we don't really care about drawing in this region.
Edges.Bottom;
public override SettingsSubsection CreateSettingsSubsectionFor(InputHandler handler)
{
switch (handler)
{
case IOSMouseHandler:
return new IOSMouseSettings();
default:
return base.CreateSettingsSubsectionFor(handler);
}
}
private class IOSBatteryInfo : BatteryInfo
{
public override double? ChargeLevel => Battery.ChargeLevel;