Add support for BC1/2/3 decompression (for 3D textures) (#2987)
* Add support for BC1/2/3 decompression (for 3D textures) * Optimize and clean up * Unsafe not needed here * Fix alpha value interpolation when a0 <= a1
This commit is contained in:
parent
8117f6a979
commit
42c75dbb8f
8 changed files with 720 additions and 143 deletions
|
@ -67,11 +67,9 @@ namespace Ryujinx.Graphics.GAL
|
|||
R10G10B10A2Uint,
|
||||
R11G11B10Float,
|
||||
R9G9B9E5Float,
|
||||
Bc1RgbUnorm,
|
||||
Bc1RgbaUnorm,
|
||||
Bc2Unorm,
|
||||
Bc3Unorm,
|
||||
Bc1RgbSrgb,
|
||||
Bc1RgbaSrgb,
|
||||
Bc2Srgb,
|
||||
Bc3Srgb,
|
||||
|
@ -349,25 +347,5 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue