Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu.Framework/Graphics/OpenGL/Textures/GLTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public unsafe bool Upload()
int count = Math.Min(uploadedRegions.Count, IRenderer.MAX_QUADS);

// Generate quad buffer that will hold all the updated regions
var quadBuffer = new GLQuadBuffer<UncolouredVertex2D>(Renderer, count, BufferUsageHint.StreamDraw);
using var quadBuffer = new GLQuadBuffer<UncolouredVertex2D>(Renderer, count, BufferUsageHint.StreamDraw);

// Compute mipmap by iteratively blitting coarser and coarser versions of the updated regions
for (int level = 1; level < IRenderer.MAX_MIPMAP_LEVELS + 1 && (width > 1 || height > 1); ++level)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace osu.Framework.Graphics.Veldrid.Buffers
{
internal abstract class VeldridVertexBuffer<T> : IVertexBuffer
internal abstract class VeldridVertexBuffer<T> : IVertexBuffer, IDisposable
where T : unmanaged, IEquatable<T>, IVertex
{
protected static readonly int STRIDE = VeldridVertexUtils<DepthWrappingVertex<T>>.STRIDE;
Expand Down
5 changes: 3 additions & 2 deletions osu.Framework/Graphics/Veldrid/Textures/VeldridTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ public bool Upload()
Renderer.BindTexture(this);
Renderer.GetMipmapShader().Bind();

using var samplingTexture = Renderer.Factory.CreateTexture(TextureDescription.Texture2D((uint)Width, (uint)Height, resources!.Texture.MipLevels, 1, resources!.Texture.Format, TextureUsage.Sampled));
using var samplingTexture =
Renderer.Factory.CreateTexture(TextureDescription.Texture2D((uint)Width, (uint)Height, resources!.Texture.MipLevels, 1, resources!.Texture.Format, TextureUsage.Sampled));
using var samplingResources = new VeldridTextureResources(samplingTexture, null);

while (uploadedRegions.Count > 0)
Expand All @@ -283,7 +284,7 @@ public bool Upload()
int count = Math.Min(uploadedRegions.Count, IRenderer.MAX_QUADS);

// Generate quad buffer that will hold all the updated regions
var quadBuffer = new VeldridQuadBuffer<UncolouredVertex2D>(Renderer, count, BufferUsage.Dynamic);
using var quadBuffer = new VeldridQuadBuffer<UncolouredVertex2D>(Renderer, count, BufferUsage.Dynamic);

// Compute mipmap by iteratively blitting coarser and coarser versions of the updated regions
for (int level = 1; level < IRenderer.MAX_MIPMAP_LEVELS + 1 && (width > 1 || height > 1); ++level)
Expand Down