mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
TextureConversionShader: Consider source format of EFB for EFB2RAM
Currently, we use the alpha channel from the EFB even if the current format does not include an alpha channel. Now, the alpha channel is set to 1 if the format does not have an alpha channel, as well as truncating to 5/6 bits per channel. This matches the EFB-to-texture behavior.
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
enum
|
||||
@ -67,6 +68,22 @@ enum TlutFormat
|
||||
GX_TL_RGB5A3 = 0x2,
|
||||
};
|
||||
|
||||
struct EFBCopyFormat
|
||||
{
|
||||
EFBCopyFormat(u32 efb_format_, TextureFormat copy_format_)
|
||||
: efb_format(efb_format_), copy_format(copy_format_)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator<(const EFBCopyFormat& rhs) const
|
||||
{
|
||||
return std::tie(efb_format, copy_format) < std::tie(rhs.efb_format, rhs.copy_format);
|
||||
}
|
||||
|
||||
u32 efb_format;
|
||||
TextureFormat copy_format;
|
||||
};
|
||||
|
||||
int TexDecoder_GetTexelSizeInNibbles(int format);
|
||||
int TexDecoder_GetTextureSizeInBytes(int width, int height, int format);
|
||||
int TexDecoder_GetBlockWidthInTexels(u32 format);
|
||||
|
Reference in New Issue
Block a user