From 92b2fd3f6cf56867547da4a9e862c78a3ee6e707 Mon Sep 17 00:00:00 2001 From: Thog Date: Sun, 17 Feb 2019 20:33:21 +0100 Subject: [PATCH] Add more check for cache invalidation & remove cubemap and cubemap array code for now Also fix compressed 2d array --- Ryujinx.Graphics/Gal/GalImage.cs | 2 +- .../Gal/OpenGL/OGLRenderTarget.cs | 2 + Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs | 62 +------------------ 3 files changed, 5 insertions(+), 61 deletions(-) diff --git a/Ryujinx.Graphics/Gal/GalImage.cs b/Ryujinx.Graphics/Gal/GalImage.cs index 49dfcefc7a..bb71f662d6 100644 --- a/Ryujinx.Graphics/Gal/GalImage.cs +++ b/Ryujinx.Graphics/Gal/GalImage.cs @@ -74,7 +74,7 @@ namespace Ryujinx.Graphics.Gal return false; } - return Height == Image.Height; + return Height == Image.Height && Depth == Image.Depth && LayerCount == Image.LayerCount; } } } \ No newline at end of file diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRenderTarget.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRenderTarget.cs index 14911cff4c..8dd3b37fc2 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLRenderTarget.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRenderTarget.cs @@ -473,6 +473,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL if (NewImage.Format == OldImage.Format && NewImage.Width == OldImage.Width && NewImage.Height == OldImage.Height && + NewImage.Depth == OldImage.Depth && + NewImage.LayerCount == OldImage.LayerCount && NewImage.TextureTarget == OldImage.TextureTarget) { return; diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs index 6f807270fe..57660f7ddd 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs @@ -108,24 +108,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL Type, IntPtr.Zero); break; - case TextureTarget.TextureCubeMap: - - int FaceSize = ImageUtils.GetSize(Image) / Image.Depth; - - for (int Face = 0; Face < 6; Face++) - { - GL.TexImage2D( - TextureTarget.TextureCubeMapPositiveX + Face, - Level, - InternalFmt, - Image.Width, - Image.Height, - Border, - Format, - Type, - IntPtr.Zero); - } - break; default: throw new NotImplementedException($"Unsupported texture target type: {Target}"); } @@ -171,7 +153,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL Data.Length, Data); break; - case TextureTarget.Texture2DArray: case TextureTarget.Texture3D: GL.CompressedTexImage3D( Target, @@ -184,33 +165,14 @@ namespace Ryujinx.Graphics.Gal.OpenGL Data.Length, Data); break; - case TextureTarget.TextureCubeMap: - Span Array = new Span(Data); - - // FIXME: wrong - int FaceSize = ImageUtils.GetSize(Image) / Image.Depth; - - for (int Face = 0; Face < 6; Face++) - { - GL.CompressedTexImage2D( - TextureTarget.TextureCubeMapPositiveX + Face, - Level, - InternalFmt, - Image.Width, - Image.Height, - Border, - FaceSize, - Array.Slice(Face * FaceSize, FaceSize).ToArray()); - } - break; - case TextureTarget.TextureCubeMapArray: + case TextureTarget.Texture2DArray: GL.CompressedTexImage3D( Target, Level, InternalFmt, Image.Width, Image.Height, - Image.LayerCount * 6, + Image.LayerCount, Border, Data.Length, Data); @@ -296,26 +258,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL Type, Data); break; - case TextureTarget.TextureCubeMap: - Span Array = new Span(Data); - - // FIXME: wrong - int FaceSize = ImageUtils.GetSize(Image) / Image.Depth; - - for (int Face = 0; Face < 6; Face++) - { - GL.TexImage2D( - TextureTarget.TextureCubeMapPositiveX + Face, - Level, - InternalFmt, - Image.Width, - Image.Height, - Border, - Format, - Type, - Array.Slice(Face * FaceSize, FaceSize).ToArray()); - } - break; default: throw new NotImplementedException($"Unsupported texture target type: {Target}"); }