resolve merge conflicts
This commit is contained in:
parent
f4190bd95a
commit
d423a53595
2 changed files with 46 additions and 2 deletions
|
@ -38,7 +38,11 @@
|
|||
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||
<<<<<<< HEAD
|
||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview14" />
|
||||
=======
|
||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview12" />
|
||||
>>>>>>> 3eab14be7 (Set scissors & viewports)
|
||||
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
||||
|
|
|
@ -440,7 +440,26 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public void SetScissors(ReadOnlySpan<Rectangle<int>> regions)
|
||||
{
|
||||
_encoderStateManager.UpdateScissors(regions);
|
||||
// TODO: Test max allowed scissor rects on device
|
||||
var mtlScissorRects = new MTLScissorRect[regions.Length];
|
||||
|
||||
for (int i = 0; i < regions.Length; i++)
|
||||
{
|
||||
var region = regions[i];
|
||||
mtlScissorRects[i] = new MTLScissorRect
|
||||
{
|
||||
height = (ulong)region.Height,
|
||||
width = (ulong)region.Width,
|
||||
x = (ulong)region.X,
|
||||
y = (ulong)region.Y
|
||||
};
|
||||
}
|
||||
|
||||
fixed (MTLScissorRect* pMtlScissorRects = mtlScissorRects)
|
||||
{
|
||||
var renderCommandEncoder = GetOrCreateRenderEncoder();
|
||||
renderCommandEncoder.SetScissorRects((IntPtr)pMtlScissorRects, (ulong)regions.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetStencilTest(StencilTestDescriptor stencilTest)
|
||||
|
@ -508,7 +527,28 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public void SetViewports(ReadOnlySpan<Viewport> viewports)
|
||||
{
|
||||
_encoderStateManager.UpdateViewports(viewports);
|
||||
// TODO: Test max allowed viewports on device
|
||||
var mtlViewports = new MTLViewport[viewports.Length];
|
||||
|
||||
for (int i = 0; i < viewports.Length; i++)
|
||||
{
|
||||
var viewport = viewports[i];
|
||||
mtlViewports[i] = new MTLViewport
|
||||
{
|
||||
originX = viewport.Region.X,
|
||||
originY = viewport.Region.Y,
|
||||
width = viewport.Region.Width,
|
||||
height = viewport.Region.Height,
|
||||
znear = viewport.DepthNear,
|
||||
zfar = viewport.DepthFar
|
||||
};
|
||||
}
|
||||
|
||||
fixed (MTLViewport* pMtlViewports = mtlViewports)
|
||||
{
|
||||
var renderCommandEncoder = GetOrCreateRenderEncoder();
|
||||
renderCommandEncoder.SetViewports((IntPtr)pMtlViewports, (ulong)viewports.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public void TextureBarrier()
|
||||
|
|
Loading…
Reference in a new issue