mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-19 21:30:53 -05:00
Check if packed depth is supported
This commit is contained in:
committed by
Evan Husted
parent
671aff68a6
commit
179482e9cb
@@ -1,9 +1,11 @@
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using SharpMetal.Metal;
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Ryujinx.Graphics.Metal
|
||||
{
|
||||
[SupportedOSPlatform("macos")]
|
||||
static class FormatTable
|
||||
{
|
||||
private static readonly MTLPixelFormat[] _table;
|
||||
@@ -167,7 +169,17 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
public static MTLPixelFormat GetFormat(Format format)
|
||||
{
|
||||
return _table[(int)format];
|
||||
var mtlFormat = _table[(int)format];
|
||||
|
||||
if (mtlFormat == MTLPixelFormat.Depth24UnormStencil8 || mtlFormat == MTLPixelFormat.Depth32FloatStencil8)
|
||||
{
|
||||
if (!MTLDevice.CreateSystemDefaultDevice().Depth24Stencil8PixelFormatSupported)
|
||||
{
|
||||
mtlFormat = MTLPixelFormat.Depth32Float;
|
||||
}
|
||||
}
|
||||
|
||||
return mtlFormat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user