mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-19 21:30:53 -05:00
Fix Depth/Stencil attachments
This commit is contained in:
committed by
Evan Husted
parent
c7b6e4cf80
commit
4190abbbf5
@@ -1,3 +1,4 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using SharpMetal.Metal;
|
||||
using System;
|
||||
@@ -64,8 +65,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
Add(Format.R32G32B32A32Sint, MTLPixelFormat.RGBA32Sint);
|
||||
Add(Format.S8Uint, MTLPixelFormat.Stencil8);
|
||||
Add(Format.D16Unorm, MTLPixelFormat.Depth16Unorm);
|
||||
// Approximate
|
||||
Add(Format.S8UintD24Unorm, MTLPixelFormat.BGRA8Unorm);
|
||||
// Add(Format.S8UintD24Unorm, MTLPixelFormat.BGRA8Unorm);
|
||||
Add(Format.D32Float, MTLPixelFormat.Depth32Float);
|
||||
Add(Format.D24UnormS8Uint, MTLPixelFormat.Depth24UnormStencil8);
|
||||
Add(Format.D32FloatS8Uint, MTLPixelFormat.Depth32FloatStencil8);
|
||||
@@ -181,5 +181,17 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
return mtlFormat;
|
||||
}
|
||||
|
||||
public static MTLPixelFormat PackedStencilToXFormat(MTLPixelFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case MTLPixelFormat.Depth24UnormStencil8: return MTLPixelFormat.X24Stencil8;
|
||||
case MTLPixelFormat.Depth32FloatStencil8: return MTLPixelFormat.X32Stencil8;
|
||||
default:
|
||||
Logger.Warning?.PrintMsg(LogClass.Gpu, $"Attempted to get stencil format for non packed format {format}!");
|
||||
return MTLPixelFormat.Invalid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user