Просмотр исходного кода

GPU: Allow depth textures to be loaded (#511)

Allow depth textures to be loaded when their component types do not match.
jduncanator 7 лет назад
Родитель
Сommit
76e2d48eee
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      Ryujinx.Graphics/Texture/ImageUtils.cs

+ 4 - 4
Ryujinx.Graphics/Texture/ImageUtils.cs

@@ -147,14 +147,14 @@ namespace Ryujinx.Graphics.Texture
             GalTextureType   AType,
             bool             ConvSrgb)
         {
-            if (RType != GType || RType != BType || RType != AType)
+            if (!s_TextureTable.TryGetValue(Format, out GalImageFormat ImageFormat))
             {
-                throw new NotImplementedException("Per component types are not implemented!");
+                throw new NotImplementedException($"Format 0x{((int)Format):x} not implemented!");
             }
 
-            if (!s_TextureTable.TryGetValue(Format, out GalImageFormat ImageFormat))
+            if (!HasDepth(ImageFormat) && (RType != GType || RType != BType || RType != AType))
             {
-                throw new NotImplementedException($"Format 0x{((int)Format):x} not implemented!");
+                throw new NotImplementedException($"Per component types are not implemented!");
             }
 
             GalImageFormat FormatType = ConvSrgb ? Srgb : GetFormatType(RType);