Fix some rebase errors
This commit is contained in:
parent
bb742f64c6
commit
62bf395970
7 changed files with 54 additions and 49 deletions
|
@ -1,6 +1,6 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using SharpMetal;
|
||||
using SharpMetal.Metal;
|
||||
|
||||
namespace Ryujinx.Graphics.Metal
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
{
|
||||
return target switch
|
||||
{
|
||||
Target.TextureBuffer => MTLTextureType.TypeTextureBuffer,
|
||||
Target.TextureBuffer => MTLTextureType.TextureBuffer,
|
||||
Target.Texture1D => MTLTextureType.Type1D,
|
||||
Target.Texture1DArray => MTLTextureType.Type1DArray,
|
||||
Target.Texture2D => MTLTextureType.Type2D,
|
||||
|
@ -176,8 +176,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
Target.Texture2DMultisample => MTLTextureType.Type2DMultisample,
|
||||
Target.Texture2DMultisampleArray => MTLTextureType.Type2DMultisampleArray,
|
||||
Target.Texture3D => MTLTextureType.Type3D,
|
||||
Target.Cubemap => MTLTextureType.TypeCube,
|
||||
Target.CubemapArray => MTLTextureType.TypeCubeArray,
|
||||
Target.Cubemap => MTLTextureType.Cube,
|
||||
Target.CubemapArray => MTLTextureType.CubeArray,
|
||||
_ => LogInvalidAndReturn(target, nameof(Target), MTLTextureType.Type2D)
|
||||
};
|
||||
}
|
||||
|
@ -203,4 +203,4 @@ namespace Ryujinx.Graphics.Metal
|
|||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@ namespace Ryujinx.Graphics.Metal
|
|||
private readonly HelperShaders _helperShaders;
|
||||
|
||||
private MTLCommandBuffer _commandBuffer;
|
||||
private MTLCommandEncoder _currentEncoder;
|
||||
private MTLTexture[] _renderTargets = Array.Empty<MTLTexture>();
|
||||
private MTLCommandEncoder? _currentEncoder;
|
||||
private MTLTexture[] _renderTargets = [];
|
||||
|
||||
private RenderEncoderState _renderEncoderState;
|
||||
private readonly MTLVertexDescriptor _vertexDescriptor = new();
|
||||
private MTLBuffer[] _vertexBuffers = Array.Empty<MTLBuffer>();
|
||||
private MTLBuffer[] _vertexBuffers = [];
|
||||
|
||||
private MTLBuffer _indexBuffer;
|
||||
private MTLIndexType _indexType;
|
||||
|
@ -393,6 +393,11 @@ namespace Ryujinx.Graphics.Metal
|
|||
}
|
||||
}
|
||||
|
||||
public void SetImage(ShaderStage stage, int binding, ITexture texture, Format imageFormat)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
||||
}
|
||||
|
||||
public void SetImage(int binding, ITexture texture, Format imageFormat)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
||||
|
|
|
@ -11,15 +11,15 @@ namespace Ryujinx.Graphics.Metal
|
|||
struct RenderEncoderState
|
||||
{
|
||||
private readonly MTLDevice _device;
|
||||
private readonly MTLFunction _vertexFunction = null;
|
||||
private readonly MTLFunction _fragmentFunction = null;
|
||||
private MTLDepthStencilState _depthStencilState = null;
|
||||
private readonly MTLFunction? _vertexFunction = null;
|
||||
private readonly MTLFunction? _fragmentFunction = null;
|
||||
private MTLDepthStencilState? _depthStencilState = null;
|
||||
|
||||
private MTLCompareFunction _depthCompareFunction = MTLCompareFunction.Always;
|
||||
private bool _depthWriteEnabled = false;
|
||||
|
||||
private MTLStencilDescriptor _backFaceStencil = null;
|
||||
private MTLStencilDescriptor _frontFaceStencil = null;
|
||||
private MTLStencilDescriptor? _backFaceStencil = null;
|
||||
private MTLStencilDescriptor? _frontFaceStencil = null;
|
||||
|
||||
public PrimitiveTopology Topology = PrimitiveTopology.Triangles;
|
||||
public MTLCullMode CullMode = MTLCullMode.None;
|
||||
|
@ -41,12 +41,12 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
if (_vertexFunction != null)
|
||||
{
|
||||
renderPipelineDescriptor.VertexFunction = _vertexFunction;
|
||||
renderPipelineDescriptor.VertexFunction = _vertexFunction.Value;
|
||||
}
|
||||
|
||||
if (_fragmentFunction != null)
|
||||
{
|
||||
renderPipelineDescriptor.FragmentFunction = _fragmentFunction;
|
||||
renderPipelineDescriptor.FragmentFunction = _fragmentFunction.Value;
|
||||
}
|
||||
|
||||
var attachment = renderPipelineDescriptor.ColorAttachments.Object(0);
|
||||
|
@ -70,7 +70,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
if (_depthStencilState != null)
|
||||
{
|
||||
renderCommandEncoder.SetDepthStencilState(_depthStencilState);
|
||||
renderCommandEncoder.SetDepthStencilState(_depthStencilState.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,13 +79,15 @@ namespace Ryujinx.Graphics.Metal
|
|||
_backFaceStencil = backFace;
|
||||
_frontFaceStencil = frontFace;
|
||||
|
||||
return _depthStencilState = _device.NewDepthStencilState(new MTLDepthStencilDescriptor
|
||||
_depthStencilState = _device.NewDepthStencilState(new MTLDepthStencilDescriptor
|
||||
{
|
||||
DepthCompareFunction = _depthCompareFunction,
|
||||
DepthWriteEnabled = _depthWriteEnabled,
|
||||
BackFaceStencil = _backFaceStencil,
|
||||
FrontFaceStencil = _frontFaceStencil
|
||||
BackFaceStencil = _backFaceStencil.Value,
|
||||
FrontFaceStencil = _frontFaceStencil.Value
|
||||
});
|
||||
|
||||
return _depthStencilState.Value;
|
||||
}
|
||||
|
||||
public MTLDepthStencilState UpdateDepthState(MTLCompareFunction depthCompareFunction, bool depthWriteEnabled)
|
||||
|
@ -93,13 +95,15 @@ namespace Ryujinx.Graphics.Metal
|
|||
_depthCompareFunction = depthCompareFunction;
|
||||
_depthWriteEnabled = depthWriteEnabled;
|
||||
|
||||
return _depthStencilState = _device.NewDepthStencilState(new MTLDepthStencilDescriptor
|
||||
_depthStencilState = _device.NewDepthStencilState(new MTLDepthStencilDescriptor
|
||||
{
|
||||
DepthCompareFunction = _depthCompareFunction,
|
||||
DepthWriteEnabled = _depthWriteEnabled,
|
||||
BackFaceStencil = _backFaceStencil,
|
||||
FrontFaceStencil = _frontFaceStencil
|
||||
BackFaceStencil = _backFaceStencil.Value,
|
||||
FrontFaceStencil = _frontFaceStencil.Value
|
||||
});
|
||||
|
||||
return _depthStencilState.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
<PackageReference Include="Silk.NET.Vulkan" />
|
||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" />
|
||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Metal" />
|
||||
<PackageReference Include="SPB" />
|
||||
<PackageReference Include="SharpZipLib" />
|
||||
</ItemGroup>
|
||||
|
@ -59,6 +60,7 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.SDL2\Ryujinx.Audio.Backends.SDL2.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Graphics.Vulkan\Ryujinx.Graphics.Vulkan.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Input.SDL2\Ryujinx.Input.SDL2.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.OpenAL\Ryujinx.Audio.Backends.OpenAL.csproj" />
|
||||
|
|
|
@ -2,7 +2,7 @@ using SPB.Windowing;
|
|||
using SPB.Platform.Metal;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.UI.Renderer
|
||||
namespace Ryujinx.Ava.UI.Renderer
|
||||
{
|
||||
public class EmbeddedWindowMetal : EmbeddedWindow
|
||||
{
|
||||
|
@ -22,4 +22,4 @@ namespace Ryujinx.UI.Renderer
|
|||
return simpleMetalWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue