Buffer Conversions (#23)

* Why is this not working

* Revert helper shader changes for now

* Byte Index Buffer Restride
This commit is contained in:
Isaac Marovitz 2024-06-20 12:59:29 +01:00
parent 02de48a6f2
commit 6ebe5bb406
10 changed files with 692 additions and 39 deletions

View file

@ -1,3 +1,4 @@
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.GAL;
using SharpMetal.Metal;
using System.Linq;
@ -21,6 +22,26 @@ namespace Ryujinx.Graphics.Metal
}
}
public record struct BufferRef
{
public Auto<DisposableBuffer> Buffer;
public int Index;
public BufferRange? Range;
public BufferRef(Auto<DisposableBuffer> buffer, int index)
{
Buffer = buffer;
Index = index;
}
public BufferRef(Auto<DisposableBuffer> buffer, int index, ref BufferRange range)
{
Buffer = buffer;
Index = index;
Range = range;
}
}
[SupportedOSPlatform("macos")]
struct EncoderState
{
@ -37,10 +58,10 @@ namespace Ryujinx.Graphics.Metal
public TextureBase[] ComputeTextures = new TextureBase[Constants.MaxTextures];
public MTLSamplerState[] ComputeSamplers = new MTLSamplerState[Constants.MaxSamplers];
public BufferAssignment[] UniformBuffers = [];
public BufferAssignment[] StorageBuffers = [];
public BufferRef[] UniformBuffers = [];
public BufferRef[] StorageBuffers = [];
public BufferRange IndexBuffer = default;
public Auto<DisposableBuffer> IndexBuffer = default;
public MTLIndexType IndexType = MTLIndexType.UInt16;
public ulong IndexBufferOffset = 0;