mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Add documentation and a bit of refactoring
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace osu.Framework.Graphics.Veldrid
|
||||
}
|
||||
|
||||
foreach (var ubo in uniformBufferResetList)
|
||||
ubo.Reset();
|
||||
ubo.ResetCounters();
|
||||
uniformBufferResetList.Clear();
|
||||
|
||||
Commands.Begin();
|
||||
|
||||
Reference in New Issue
Block a user