diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-11-01 15:32:53 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-01 15:32:53 -0300 |
| commit | 11a7c99764ed4e6c575c877c69ca627645702a42 (patch) | |
| tree | 27f085e7242dd417dbe691a7a4f13d42f76cf58b /Ryujinx.Graphics.Gpu/Image/TextureManager.cs | |
| parent | 6222f173f0c85a55d31655ddb78638907c07e1ce (diff) | |
Support 3D BC4 and BC5 compressed textures (#1655)
* Support 3D BC4 and BC5 compressed textures
* PR feedback
* Fix some typos
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureManager.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureManager.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs index b0e715ea..7588258f 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs @@ -1058,19 +1058,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// <returns>The texture creation information</returns> public static TextureCreateInfo GetCreateInfo(TextureInfo info, Capabilities caps, float scale) { - FormatInfo formatInfo = info.FormatInfo; - - if (!caps.SupportsAstcCompression) - { - if (formatInfo.Format.IsAstcUnorm()) - { - formatInfo = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4, 4); - } - else if (formatInfo.Format.IsAstcSrgb()) - { - formatInfo = new FormatInfo(Format.R8G8B8A8Srgb, 1, 1, 4, 4); - } - } + FormatInfo formatInfo = TextureCompatibility.ToHostCompatibleFormat(info, caps); if (info.Target == Target.TextureBuffer) { @@ -1079,12 +1067,24 @@ namespace Ryujinx.Graphics.Gpu.Image // The shader will need the appropriate conversion code to compensate. switch (formatInfo.Format) { - case Format.R8Snorm: formatInfo = new FormatInfo(Format.R8Sint, 1, 1, 1, 1); break; - case Format.R16Snorm: formatInfo = new FormatInfo(Format.R16Sint, 1, 1, 2, 1); break; - case Format.R8G8Snorm: formatInfo = new FormatInfo(Format.R8G8Sint, 1, 1, 2, 2); break; - case Format.R16G16Snorm: formatInfo = new FormatInfo(Format.R16G16Sint, 1, 1, 4, 2); break; - case Format.R8G8B8A8Snorm: formatInfo = new FormatInfo(Format.R8G8B8A8Sint, 1, 1, 4, 4); break; - case Format.R16G16B16A16Snorm: formatInfo = new FormatInfo(Format.R16G16B16A16Sint, 1, 1, 8, 4); break; + case Format.R8Snorm: + formatInfo = new FormatInfo(Format.R8Sint, 1, 1, 1, 1); + break; + case Format.R16Snorm: + formatInfo = new FormatInfo(Format.R16Sint, 1, 1, 2, 1); + break; + case Format.R8G8Snorm: + formatInfo = new FormatInfo(Format.R8G8Sint, 1, 1, 2, 2); + break; + case Format.R16G16Snorm: + formatInfo = new FormatInfo(Format.R16G16Sint, 1, 1, 4, 2); + break; + case Format.R8G8B8A8Snorm: + formatInfo = new FormatInfo(Format.R8G8B8A8Sint, 1, 1, 4, 4); + break; + case Format.R16G16B16A16Snorm: + formatInfo = new FormatInfo(Format.R16G16B16A16Sint, 1, 1, 8, 4); + break; } } |
