Add documentation and a bit of refactoring

This commit is contained in:
Dan Balasescu
2023-03-16 15:15:53 +09:00
parent e830df99a7
commit ea11a767b2
3 changed files with 13 additions and 3 deletions

View File

@@ -17,6 +17,9 @@ namespace osu.Framework.Graphics.Rendering
public interface IUniformBuffer<TData> : IUniformBuffer
where TData : unmanaged, IEquatable<TData>
{
/// <summary>
/// The data contained by this <see cref="IUniformBuffer{TData}"/>.
/// </summary>
TData Data { get; set; }
}
}

View File

@@ -10,9 +10,16 @@ namespace osu.Framework.Graphics.Veldrid.Buffers
{
internal interface IVeldridUniformBuffer : IDisposable
{
/// <summary>
/// Gets the <see cref="ResourceSet"/> containing the buffer attached to the given layout.
/// </summary>
/// <param name="layout">The <see cref="ResourceLayout"/> which the buffer should be attached to.</param>
ResourceSet GetResourceSet(ResourceLayout layout);
void Reset();
/// <summary>
/// Resets this <see cref="IVeldridUniformBuffer"/>, bringing it to the initial state.
/// </summary>
void ResetCounters();
}
internal class VeldridUniformBuffer<TData> : IUniformBuffer<TData>, IVeldridUniformBuffer
@@ -48,7 +55,7 @@ namespace osu.Framework.Graphics.Veldrid.Buffers
public ResourceSet GetResourceSet(ResourceLayout layout) => storages[currentStorageIndex].GetResourceSet(layout);
public void Reset()
public void ResetCounters()
{
currentStorageIndex = 0;
}

View File

@@ -179,7 +179,7 @@ namespace osu.Framework.Graphics.Veldrid
}
foreach (var ubo in uniformBufferResetList)
ubo.Reset();
ubo.ResetCounters();
uniformBufferResetList.Clear();
Commands.Begin();