From 1ec77a3810cfc0b5f7e70895d00ffc492bde4484 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 7 Sep 2024 17:10:28 +0900 Subject: [PATCH 1/5] Update veldrid-spirv --- osu.Framework/osu.Framework.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Framework/osu.Framework.csproj b/osu.Framework/osu.Framework.csproj index 6d70baf3d8..2397f2b987 100644 --- a/osu.Framework/osu.Framework.csproj +++ b/osu.Framework/osu.Framework.csproj @@ -29,7 +29,7 @@ - + From 024fd0b437c7c846d10eedd03db3f6122b49f0a1 Mon Sep 17 00:00:00 2001 From: NebulaDev <96085977+Nebula-Developer@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:49:20 +1200 Subject: [PATCH 2/5] Fix typo --- osu.Framework/Graphics/Containers/CompositeDrawable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Framework/Graphics/Containers/CompositeDrawable.cs b/osu.Framework/Graphics/Containers/CompositeDrawable.cs index b113bfb35e..3d9de04b5f 100644 --- a/osu.Framework/Graphics/Containers/CompositeDrawable.cs +++ b/osu.Framework/Graphics/Containers/CompositeDrawable.cs @@ -35,7 +35,7 @@ namespace osu.Framework.Graphics.Containers { /// /// A drawable consisting of a composite of child drawables which are - /// manages by the composite object itself. Transformations applied to + /// managed by the composite object itself. Transformations applied to /// a are also applied to its children. /// Additionally, s support various effects, such as masking, edge effect, /// padding, and automatic sizing depending on their children. From e44c2a661a2505b44aa0635c10562f0681687f05 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 11 Sep 2024 02:37:44 +0900 Subject: [PATCH 3/5] Remove closure allocations in VeldridStagingTexturePool --- .../Rendering/Deferred/Allocation/DeviceBufferPool.cs | 2 +- .../Graphics/Veldrid/VeldridStagingResourcePool.cs | 7 +++++-- .../Graphics/Veldrid/VeldridStagingTexturePool.cs | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/osu.Framework/Graphics/Rendering/Deferred/Allocation/DeviceBufferPool.cs b/osu.Framework/Graphics/Rendering/Deferred/Allocation/DeviceBufferPool.cs index 36ec247584..0ee1403d8c 100644 --- a/osu.Framework/Graphics/Rendering/Deferred/Allocation/DeviceBufferPool.cs +++ b/osu.Framework/Graphics/Rendering/Deferred/Allocation/DeviceBufferPool.cs @@ -32,7 +32,7 @@ public DeviceBufferPool(GraphicsPipeline pipeline, uint bufferSize, BufferUsage public IPooledDeviceBuffer Get() { - if (TryGet(_ => true, out IPooledDeviceBuffer? existing)) + if (TryGet(out IPooledDeviceBuffer? existing)) return existing; existing = new PooledDeviceBuffer(Pipeline, bufferSize, usage); diff --git a/osu.Framework/Graphics/Veldrid/VeldridStagingResourcePool.cs b/osu.Framework/Graphics/Veldrid/VeldridStagingResourcePool.cs index f36486a10a..afe09382b1 100644 --- a/osu.Framework/Graphics/Veldrid/VeldridStagingResourcePool.cs +++ b/osu.Framework/Graphics/Veldrid/VeldridStagingResourcePool.cs @@ -32,7 +32,10 @@ protected VeldridStagingResourcePool(GraphicsPipeline pipeline, string name) pipeline.ExecutionFinished += executionFinished; } - protected bool TryGet(Predicate match, [NotNullWhen(true)] out T? resource) + protected bool TryGet([NotNullWhen(true)] out T? resource) + => TryGet(static (_, _) => true, null, out resource); + + protected bool TryGet(Func match, TState? state, [NotNullWhen(true)] out T? resource) { // Reverse iteration is important to prefer reusing recently returned textures. // This avoids the case of a large pool being constantly cycled and therefore never @@ -41,7 +44,7 @@ protected bool TryGet(Predicate match, [NotNullWhen(true)] out T? resource) { var existing = available[i]; - if (match(existing.Resource)) + if (match(existing.Resource, state)) { existing.FrameUsageIndex = currentExecutionIndex; diff --git a/osu.Framework/Graphics/Veldrid/VeldridStagingTexturePool.cs b/osu.Framework/Graphics/Veldrid/VeldridStagingTexturePool.cs index 889e16ba73..90cbd28f59 100644 --- a/osu.Framework/Graphics/Veldrid/VeldridStagingTexturePool.cs +++ b/osu.Framework/Graphics/Veldrid/VeldridStagingTexturePool.cs @@ -15,12 +15,17 @@ public VeldridStagingTexturePool(GraphicsPipeline pipeline) public Texture Get(int width, int height, PixelFormat format) { - if (TryGet(t => t.Width >= width && t.Height >= height && t.Format == format, out var texture)) + if (TryGet(match, new TextureLookup(width, height, format), out var texture)) return texture; texture = Pipeline.Factory.CreateTexture(TextureDescription.Texture2D((uint)width, (uint)height, 1, 1, format, TextureUsage.Staging)); AddNewResource(texture); return texture; } + + private static bool match(Texture texture, TextureLookup lookup) + => texture.Width >= lookup.Width && texture.Height >= lookup.Height && texture.Format == lookup.Format; + + private readonly record struct TextureLookup(int Width, int Height, PixelFormat Format); } } From 516fae57a36d6537794e2396566e2d2f6a24832b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 12 Sep 2024 14:08:09 +0900 Subject: [PATCH 4/5] Add rider migration --- osu-framework.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/osu-framework.sln.DotSettings b/osu-framework.sln.DotSettings index 8d99de1456..3f68824f12 100644 --- a/osu-framework.sln.DotSettings +++ b/osu-framework.sln.DotSettings @@ -849,6 +849,7 @@ See the LICENCE file in the repository root for full licence text. True True True + True True True True From 3b74bd61cafc1c5547dbdc89dd6b87d87ff10b07 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 12 Sep 2024 14:21:36 +0900 Subject: [PATCH 5/5] Update nativelibs --- osu.Framework/osu.Framework.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Framework/osu.Framework.csproj b/osu.Framework/osu.Framework.csproj index 2397f2b987..e26e766447 100644 --- a/osu.Framework/osu.Framework.csproj +++ b/osu.Framework/osu.Framework.csproj @@ -45,7 +45,7 @@ - +