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

Enable stencil texturing (fixes #866) (#910)

gdkchan 6 лет назад
Родитель
Сommit
0202f150d4
2 измененных файлов с 3 добавлено и 5 удалено
  1. 2 2
      Ryujinx.Graphics.OpenGL/EnumConversion.cs
  2. 1 3
      Ryujinx.Graphics.OpenGL/TextureView.cs

+ 2 - 2
Ryujinx.Graphics.OpenGL/EnumConversion.cs

@@ -193,9 +193,9 @@ namespace Ryujinx.Graphics.OpenGL
             switch (mode)
             switch (mode)
             {
             {
                 case DepthStencilMode.Depth:
                 case DepthStencilMode.Depth:
-                    return All.Depth;
+                    return All.DepthComponent;
                 case DepthStencilMode.Stencil:
                 case DepthStencilMode.Stencil:
-                    return All.Stencil;
+                    return All.StencilIndex;
             }
             }
 
 
             Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}.");
             Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}.");

+ 1 - 3
Ryujinx.Graphics.OpenGL/TextureView.cs

@@ -100,9 +100,7 @@ namespace Ryujinx.Graphics.OpenGL
             }
             }
 
 
             GL.TexParameter(target, TextureParameterName.TextureMaxLevel, maxLevel);
             GL.TexParameter(target, TextureParameterName.TextureMaxLevel, maxLevel);
-
-            // TODO: This requires ARB_stencil_texturing, we should uncomment and test this.
-            // GL.TexParameter(target, TextureParameterName.DepthStencilTextureMode, (int)_info.DepthStencilMode.Convert());
+            GL.TexParameter(target, TextureParameterName.DepthStencilTextureMode, (int)_info.DepthStencilMode.Convert());
         }
         }
 
 
         public ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel)
         public ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel)