aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-12-26 18:50:27 +0000
committerGitHub <noreply@github.com>2022-12-26 15:50:27 -0300
commit470be03c2ff22346a1f0ae53fa25f53c4d1790b5 (patch)
tree7ce75f2ac860063279893571c762257806e197b5 /Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
parentc963b3c80488f88c9d7f44588b6ba45051af3e2d (diff)
GPU: Add fallback when 16-bit formats are not supported (#4108)1.1.492
* Add conversion for 16 bit RGBA formats (not supported in Rosetta) * Rebase fix Rebase fix * Forgot to remove this * Fix RGBA16 format conversion * Add RGBA4 -> RGBA8 conversion * Handle host stride alignment * Address Feedback Part 1 * Can't count * Don't zero out rgb when alpha is 0 * Separate RGBA4 and 5-bit component formats Not sure of a better way to name them... * Add A1B5G5R5 conversion * Put this in the right place. * Make format naming consistent for capabilities * Change method names
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
index 642e03b6..7ec4c7ac 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
@@ -132,7 +132,26 @@ namespace Ryujinx.Graphics.Gpu.Image
if (!caps.SupportsR4G4Format && info.FormatInfo.Format == Format.R4G4Unorm)
{
- return new FormatInfo(Format.R4G4B4A4Unorm, 1, 1, 2, 4);
+ if (caps.SupportsR4G4B4A4Format)
+ {
+ return new FormatInfo(Format.R4G4B4A4Unorm, 1, 1, 2, 4);
+ }
+ else
+ {
+ return new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4, 4);
+ }
+ }
+
+ if (info.FormatInfo.Format == Format.R4G4B4A4Unorm)
+ {
+ if (!caps.SupportsR4G4B4A4Format)
+ {
+ return new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4, 4);
+ }
+ }
+ else if (!caps.Supports5BitComponentFormat && info.FormatInfo.Format.Is16BitPacked())
+ {
+ return new FormatInfo(info.FormatInfo.Format.IsBgr() ? Format.B8G8R8A8Unorm : Format.R8G8B8A8Unorm, 1, 1, 4, 4);
}
return info.FormatInfo;