Cleanup + Format

This commit is contained in:
Isaac Marovitz
2024-05-23 14:08:34 -04:00
committed by Evan Husted
parent 58fb8564a8
commit bea46ff9ce
10 changed files with 71 additions and 93 deletions

View File

@@ -1,9 +1,7 @@
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL;
using SharpMetal.Foundation;
using SharpMetal.Metal;
using System;
using System.Collections.Generic;
using System.Runtime.Versioning;
namespace Ryujinx.Graphics.Metal
@@ -72,16 +70,24 @@ namespace Ryujinx.Graphics.Metal
{
private readonly MTLDevice _device;
public RenderPipelineCache(MTLDevice device) {
public RenderPipelineCache(MTLDevice device)
{
_device = device;
}
protected override RenderPipelineHash GetHash(MTLRenderPipelineDescriptor descriptor) {
var hash = new RenderPipelineHash();
// Functions
hash.VertexFunction = descriptor.VertexFunction;
hash.FragmentFunction = descriptor.FragmentFunction;
protected override RenderPipelineHash GetHash(MTLRenderPipelineDescriptor descriptor)
{
var hash = new RenderPipelineHash
{
// Functions
VertexFunction = descriptor.VertexFunction,
FragmentFunction = descriptor.FragmentFunction,
DepthStencilAttachment = new RenderPipelineHash.DepthStencilAttachmentHash
{
DepthPixelFormat = descriptor.DepthAttachmentPixelFormat,
StencilPixelFormat = descriptor.StencilAttachmentPixelFormat
},
};
// Color Attachments
for (int i = 0; i < Constants.MaxColorAttachments; i++)
@@ -100,13 +106,6 @@ namespace Ryujinx.Graphics.Metal
};
}
// Depth stencil attachment
hash.DepthStencilAttachment = new RenderPipelineHash.DepthStencilAttachmentHash
{
DepthPixelFormat = descriptor.DepthAttachmentPixelFormat,
StencilPixelFormat = descriptor.StencilAttachmentPixelFormat
};
// Vertex descriptor
hash.VertexDescriptor = new RenderPipelineHash.VertexDescriptorHash();