aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-04-10 18:54:50 -0300
committergdkchan <gab.dark.100@gmail.com>2018-04-10 18:54:50 -0300
commit7b2f471d4ff07bc811bbd84919c6708ab0f399f4 (patch)
tree07602996009587194fad2a895d47dca4e75719f3
parentf57fd95fd9ee12e2dec0af891604a447ea69adce (diff)
[GPU] Add support for the BC4/5 texture formats
-rw-r--r--Ryujinx.Core/OsHle/Services/Nv/INvDrvServices.cs2
-rw-r--r--Ryujinx.Graphics/Gal/GalTextureFormat.cs4
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs2
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs14
-rw-r--r--Ryujinx.Graphics/Gpu/TextureReader.cs2
5 files changed, 20 insertions, 4 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Nv/INvDrvServices.cs b/Ryujinx.Core/OsHle/Services/Nv/INvDrvServices.cs
index e41f03a4..800926df 100644
--- a/Ryujinx.Core/OsHle/Services/Nv/INvDrvServices.cs
+++ b/Ryujinx.Core/OsHle/Services/Nv/INvDrvServices.cs
@@ -316,6 +316,8 @@ namespace Ryujinx.Core.OsHle.Services.Nv
int Padding = Reader.ReadInt32();
int Offset = Reader.ReadInt32();
int Pages = Reader.ReadInt32();
+
+ System.Console.WriteLine("remap " + Offset.ToString("x8") + " " + Pages.ToString("x8"));
}
//TODO
diff --git a/Ryujinx.Graphics/Gal/GalTextureFormat.cs b/Ryujinx.Graphics/Gal/GalTextureFormat.cs
index 8c2c718a..37291e18 100644
--- a/Ryujinx.Graphics/Gal/GalTextureFormat.cs
+++ b/Ryujinx.Graphics/Gal/GalTextureFormat.cs
@@ -7,6 +7,8 @@ namespace Ryujinx.Graphics.Gal
B5G6R5 = 0x15,
BC1 = 0x24,
BC2 = 0x25,
- BC3 = 0x26
+ BC3 = 0x26,
+ BC4 = 0x27,
+ BC5 = 0x28
}
}
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
index 03c3ef52..17bf6291 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
@@ -74,6 +74,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
case GalTextureFormat.BC1: return PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
case GalTextureFormat.BC2: return PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
case GalTextureFormat.BC3: return PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
+ case GalTextureFormat.BC4: return PixelInternalFormat.CompressedRedRgtc1;
+ case GalTextureFormat.BC5: return PixelInternalFormat.CompressedRgRgtc2;
}
throw new NotImplementedException(Format.ToString());
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs
index 681e6d67..b7c8999e 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs
@@ -85,9 +85,17 @@ namespace Ryujinx.Graphics.Gal.OpenGL
private static bool IsCompressedTextureFormat(GalTextureFormat Format)
{
- return Format == GalTextureFormat.BC1 ||
- Format == GalTextureFormat.BC2 ||
- Format == GalTextureFormat.BC3;
+ switch (Format)
+ {
+ case GalTextureFormat.BC1:
+ case GalTextureFormat.BC2:
+ case GalTextureFormat.BC3:
+ case GalTextureFormat.BC4:
+ case GalTextureFormat.BC5:
+ return true;
+ }
+
+ return false;
}
private int EnsureTextureInitialized(int TexIndex)
diff --git a/Ryujinx.Graphics/Gpu/TextureReader.cs b/Ryujinx.Graphics/Gpu/TextureReader.cs
index 715578b5..b3b016ed 100644
--- a/Ryujinx.Graphics/Gpu/TextureReader.cs
+++ b/Ryujinx.Graphics/Gpu/TextureReader.cs
@@ -16,6 +16,8 @@ namespace Ryujinx.Graphics.Gpu
case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);
case GalTextureFormat.BC2: return Read16Bpt4x4(Memory, Texture);
case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture);
+ case GalTextureFormat.BC4: return Read8Bpt4x4 (Memory, Texture);
+ case GalTextureFormat.BC5: return Read16Bpt4x4(Memory, Texture);
}
throw new NotImplementedException(Texture.Format.ToString());