From 76e2d48eeedfbb5419c957d41478b8b1235f26e5 Mon Sep 17 00:00:00 2001 From: jduncanator <1518948+jduncanator@users.noreply.github.com> Date: Wed, 21 Nov 2018 17:27:33 +1100 Subject: [PATCH] GPU: Allow depth textures to be loaded (#511) Allow depth textures to be loaded when their component types do not match. --- Ryujinx.Graphics/Texture/ImageUtils.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Ryujinx.Graphics/Texture/ImageUtils.cs b/Ryujinx.Graphics/Texture/ImageUtils.cs index 89c29557..417d7998 100644 --- a/Ryujinx.Graphics/Texture/ImageUtils.cs +++ b/Ryujinx.Graphics/Texture/ImageUtils.cs @@ -147,16 +147,16 @@ namespace Ryujinx.Graphics.Texture GalTextureType AType, bool ConvSrgb) { - if (RType != GType || RType != BType || RType != AType) - { - throw new NotImplementedException("Per component types are not implemented!"); - } - if (!s_TextureTable.TryGetValue(Format, out GalImageFormat ImageFormat)) { throw new NotImplementedException($"Format 0x{((int)Format):x} not implemented!"); } + if (!HasDepth(ImageFormat) && (RType != GType || RType != BType || RType != AType)) + { + throw new NotImplementedException($"Per component types are not implemented!"); + } + GalImageFormat FormatType = ConvSrgb ? Srgb : GetFormatType(RType); GalImageFormat CombinedFormat = (ImageFormat & GalImageFormat.FormatMask) | FormatType;