mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 23:10:47 -07:00
Allow swizzles to match with "undefined" components (#1538)
* Add swizzle matching rules. Improves rules which try to match incompatible formats as perfect, such as D32 float -> R32 float. Remove Format.HasOneComponent, since this information is now available via the FormatInfo struct. * Fix this rule. * Update component counts for depth formats.
This commit is contained in:
@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// <summary>
|
||||
/// A default, generic RGBA8 texture format.
|
||||
/// </summary>
|
||||
public static FormatInfo Default { get; } = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4);
|
||||
public static FormatInfo Default { get; } = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4, 4);
|
||||
|
||||
/// <summary>
|
||||
/// The format of the texture data.
|
||||
@ -38,6 +38,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// </summary>
|
||||
public int BytesPerPixel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of components this format has defined (in RGBA order).
|
||||
/// </summary>
|
||||
public int Components { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whenever or not the texture format is a compressed format. Determined from block size.
|
||||
/// </summary>
|
||||
@ -54,12 +59,14 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
Format format,
|
||||
int blockWidth,
|
||||
int blockHeight,
|
||||
int bytesPerPixel)
|
||||
int bytesPerPixel,
|
||||
int components)
|
||||
{
|
||||
Format = format;
|
||||
BlockWidth = blockWidth;
|
||||
BlockHeight = blockHeight;
|
||||
BytesPerPixel = bytesPerPixel;
|
||||
Components = components;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user