Support 3D BC4 and BC5 compressed textures (#1655)

* Support 3D BC4 and BC5 compressed textures

* PR feedback

* Fix some typos
This commit is contained in:
gdkchan 2020-11-01 15:32:53 -03:00 committed by GitHub
parent 6222f173f0
commit 11a7c99764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 357 additions and 32 deletions

View file

@ -341,5 +341,25 @@ namespace Ryujinx.Graphics.GAL
{
return format.IsUint() || format.IsSint();
}
/// <summary>
/// Checks if the texture format is a BC4 compressed format.
/// </summary>
/// <param name="format">Texture format</param>
/// <returns>True if the texture format is a BC4 compressed format, false otherwise</returns>
public static bool IsBc4(this Format format)
{
return format == Format.Bc4Unorm || format == Format.Bc4Snorm;
}
/// <summary>
/// Checks if the texture format is a BC5 compressed format.
/// </summary>
/// <param name="format">Texture format</param>
/// <returns>True if the texture format is a BC5 compressed format, false otherwise</returns>
public static bool IsBc5(this Format format)
{
return format == Format.Bc5Unorm || format == Format.Bc5Snorm;
}
}
}