mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 11:03:04 +00:00
Properly create stencil views of combined formats
Fixes Link’s Awakening
This commit is contained in:
parent
b43ff78ba1
commit
691b0de6e1
1 changed files with 11 additions and 0 deletions
|
@ -59,6 +59,17 @@ namespace Ryujinx.Graphics.Metal
|
||||||
public Texture(MTLDevice device, MetalRenderer renderer, Pipeline pipeline, TextureCreateInfo info, MTLTexture sourceTexture, int firstLayer, int firstLevel) : base(device, renderer, pipeline, info)
|
public Texture(MTLDevice device, MetalRenderer renderer, Pipeline pipeline, TextureCreateInfo info, MTLTexture sourceTexture, int firstLayer, int firstLevel) : base(device, renderer, pipeline, info)
|
||||||
{
|
{
|
||||||
var pixelFormat = FormatTable.GetFormat(Info.Format);
|
var pixelFormat = FormatTable.GetFormat(Info.Format);
|
||||||
|
|
||||||
|
if (info.DepthStencilMode == DepthStencilMode.Stencil)
|
||||||
|
{
|
||||||
|
pixelFormat = pixelFormat switch
|
||||||
|
{
|
||||||
|
MTLPixelFormat.Depth32FloatStencil8 => MTLPixelFormat.X32Stencil8,
|
||||||
|
MTLPixelFormat.Depth24UnormStencil8 => MTLPixelFormat.X24Stencil8,
|
||||||
|
_ => pixelFormat
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var textureType = Info.Target.Convert();
|
var textureType = Info.Target.Convert();
|
||||||
NSRange levels;
|
NSRange levels;
|
||||||
levels.location = (ulong)firstLevel;
|
levels.location = (ulong)firstLevel;
|
||||||
|
|
Loading…
Reference in a new issue