Fix Geometry/TFB on compute, Buffer Textures, add Window Resizing (#28)

This commit is contained in:
riperiperi 2024-06-29 19:07:07 +01:00 committed by Isaac Marovitz
parent e02df72323
commit edceb1607f
28 changed files with 280 additions and 92 deletions

View file

@ -347,13 +347,15 @@ namespace Ryujinx.Graphics.Metal
BufferHolder.Copy(this, Cbs, srcBuffer, dstBuffer, srcOffset, dstOffset, size);
}
public void DispatchCompute(int groupsX, int groupsY, int groupsZ, int groupSizeX, int groupSizeY, int groupSizeZ)
public void DispatchCompute(int groupsX, int groupsY, int groupsZ)
{
var computeCommandEncoder = GetOrCreateComputeEncoder(true);
ComputeSize localSize = _encoderStateManager.ComputeLocalSize;
computeCommandEncoder.DispatchThreadgroups(
new MTLSize { width = (ulong)groupsX, height = (ulong)groupsY, depth = (ulong)groupsZ },
new MTLSize { width = (ulong)groupSizeX, height = (ulong)groupSizeY, depth = (ulong)groupSizeZ });
new MTLSize { width = (ulong)localSize.X, height = (ulong)localSize.Y, depth = (ulong)localSize.Z });
}
public void Draw(int vertexCount, int instanceCount, int firstVertex, int firstInstance)
@ -658,12 +660,11 @@ namespace Ryujinx.Graphics.Metal
{
if (texture is TextureBase tex)
{
if (sampler is Sampler samp)
if (sampler == null || sampler is Sampler)
{
var mtlSampler = samp.GetSampler();
var index = (ulong)binding;
_encoderStateManager.UpdateTextureAndSampler(stage, index, tex, mtlSampler);
_encoderStateManager.UpdateTextureAndSampler(stage, index, tex, (Sampler)sampler);
}
}
}