Formatting

This commit is contained in:
Isaac Marovitz
2023-08-03 14:50:49 -04:00
committed by Evan Husted
parent a8b4e643d0
commit 7441d94f10
15 changed files with 1386 additions and 81 deletions

View File

@@ -30,17 +30,18 @@ namespace Ryujinx.Graphics.Metal
}
[SupportedOSPlatform("macos")]
public struct HelperShader
public readonly struct HelperShader
{
private MTLRenderPipelineState _pipelineState;
private readonly MTLRenderPipelineState _pipelineState;
public static implicit operator MTLRenderPipelineState(HelperShader shader) => shader._pipelineState;
public HelperShader(MTLDevice device, MTLLibrary library, string vertex, string fragment)
{
var renderPipelineDescriptor = new MTLRenderPipelineDescriptor();
renderPipelineDescriptor.VertexFunction = library.NewFunction(StringHelper.NSString(vertex));;
renderPipelineDescriptor.FragmentFunction = library.NewFunction(StringHelper.NSString(fragment));
var renderPipelineDescriptor = new MTLRenderPipelineDescriptor
{
VertexFunction = library.NewFunction(StringHelper.NSString(vertex)),
FragmentFunction = library.NewFunction(StringHelper.NSString(fragment))
};
renderPipelineDescriptor.ColorAttachments.Object(0).SetBlendingEnabled(true);
renderPipelineDescriptor.ColorAttachments.Object(0).PixelFormat = MTLPixelFormat.BGRA8Unorm;
renderPipelineDescriptor.ColorAttachments.Object(0).SourceAlphaBlendFactor = MTLBlendFactor.SourceAlpha;