summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureDecoder.h
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-04-04 23:53:03 +1000
committerStenzek <stenzek@gmail.com>2017-04-12 00:11:22 +1000
commit3847e226abd7e69d42796d47a61cfd539a430438 (patch)
treed747caa4c0ff80d939ed82e0ca8c63750ba4aec8 /Source/Core/VideoCommon/TextureDecoder.h
parent4e90c5da8b3c4de34aea8a2521e7612d64f6c7c6 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/TextureDecoder.h')
-rw-r--r--Source/Core/VideoCommon/TextureDecoder.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h
index 44834c0623..b424dd324f 100644
--- a/Source/Core/VideoCommon/TextureDecoder.h
+++ b/Source/Core/VideoCommon/TextureDecoder.h
@@ -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);