1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2025-02-19 06:45:45 +00:00
Ryujinx/src/Ryujinx.Graphics.Metal/RenderEncoderState.cs

30 lines
1 KiB
C#
Raw Normal View History

2023-07-28 16:23:13 -04:00
using Ryujinx.Graphics.GAL;
using SharpMetal.Metal;
using System.Runtime.Versioning;
namespace Ryujinx.Graphics.Metal
{
[SupportedOSPlatform("macos")]
struct RenderEncoderState
{
public MTLRenderPipelineState RenderPipelineState;
public PrimitiveTopology Topology = PrimitiveTopology.Triangles;
public MTLCullMode CullMode = MTLCullMode.None;
public MTLWinding Winding = MTLWinding.Clockwise;
2023-07-29 00:30:08 -04:00
public MTLDepthStencilState DepthStencilState = null;
2023-07-28 16:23:13 -04:00
public RenderEncoderState(MTLRenderPipelineState renderPipelineState)
{
RenderPipelineState = renderPipelineState;
}
public void SetEncoderState(MTLRenderCommandEncoder renderCommandEncoder)
{
renderCommandEncoder.SetRenderPipelineState(RenderPipelineState);
renderCommandEncoder.SetCullMode(CullMode);
renderCommandEncoder.SetFrontFacingWinding(Winding);
2023-07-29 00:30:08 -04:00
renderCommandEncoder.SetDepthStencilState(DepthStencilState);
2023-07-28 16:23:13 -04:00
}
}
}