From b9be3245e1bcd3929baf4d1c66fe5a14b336cdbc Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 5 Sep 2015 02:45:29 +1200 Subject: Move common EFB copy code into VideoCommon Addded a few duplicated depth copy texture formats to the enum in TextureDecoder.h. These texture formats were already implemented in TextureCacheBase and the ogl/dx11 texture cache implementations. --- Source/Core/VideoCommon/TextureDecoder.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/TextureDecoder.h') diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index 1abcc5705c..fd3ee43ff7 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -35,7 +35,6 @@ enum TextureFormat GX_CTF_R4 = 0x0 | _GX_TF_CTF, GX_CTF_RA4 = 0x2 | _GX_TF_CTF, GX_CTF_RA8 = 0x3 | _GX_TF_CTF, - GX_CTF_YUVA8 = 0x6 | _GX_TF_CTF, GX_CTF_A8 = 0x7 | _GX_TF_CTF, GX_CTF_R8 = 0x8 | _GX_TF_CTF, GX_CTF_G8 = 0x9 | _GX_TF_CTF, @@ -43,13 +42,17 @@ enum TextureFormat GX_CTF_RG8 = 0xB | _GX_TF_CTF, GX_CTF_GB8 = 0xC | _GX_TF_CTF, + // Texture formats (which match the color formats above) GX_TF_Z8 = 0x1 | _GX_TF_ZTF, GX_TF_Z16 = 0x3 | _GX_TF_ZTF, GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF, + // copy only texture formats GX_CTF_Z4 = 0x0 | _GX_TF_ZTF | _GX_TF_CTF, + GX_CTF_Z8H = 0x8 | _GX_TF_ZTF | _GX_TF_CTF, // This produces an identical result to to GX_TF_Z8 GX_CTF_Z8M = 0x9 | _GX_TF_ZTF | _GX_TF_CTF, GX_CTF_Z8L = 0xA | _GX_TF_ZTF | _GX_TF_CTF, + GX_CTF_Z16R = 0xB | _GX_TF_ZTF | _GX_TF_CTF, // Reversed version of GX_TF_Z16 GX_CTF_Z16L = 0xC | _GX_TF_ZTF | _GX_TF_CTF, }; -- cgit v1.2.3 From e745748c3ec56f76c1d087ccd5d79484d4fd2084 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 5 Sep 2015 18:33:50 +1200 Subject: Improve comments for texture formats enum. --- Source/Core/VideoCommon/TextureDecoder.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Source/Core/VideoCommon/TextureDecoder.h') diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index fd3ee43ff7..be0c8f44e0 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -16,6 +16,7 @@ extern GC_ALIGNED16(u8 texMem[TMEM_SIZE]); enum TextureFormat { + // These are the texture formats that can be read by the texture mapper. GX_TF_I4 = 0x0, GX_TF_I8 = 0x1, GX_TF_IA4 = 0x2, @@ -28,13 +29,21 @@ enum TextureFormat GX_TF_C14X2 = 0xA, GX_TF_CMPR = 0xE, - _GX_TF_CTF = 0x20, // copy-texture-format only (simply means linear?) - _GX_TF_ZTF = 0x10, // Z-texture-format + _GX_TF_ZTF = 0x10, // flag for Z texture formats (used internally by dolphin) - // these formats are also valid when copying targets + // Depth texture formats (which directly map to the equivalent colour format above.) + GX_TF_Z8 = 0x1 | _GX_TF_ZTF, + GX_TF_Z16 = 0x3 | _GX_TF_ZTF, + GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF, + + _GX_TF_CTF = 0x20, // flag for copy-texture-format only (used internally by dolphin) + + // These are extra formats that can be used when copying from efb, + // they use one of texel formats from above, but pack diffrent data into them. GX_CTF_R4 = 0x0 | _GX_TF_CTF, GX_CTF_RA4 = 0x2 | _GX_TF_CTF, GX_CTF_RA8 = 0x3 | _GX_TF_CTF, + GX_CTF_YUVA8 = 0x6 | _GX_TF_CTF, // YUV 4:4:4 - Dolphin doesn't implement this format as no commercial games use it GX_CTF_A8 = 0x7 | _GX_TF_CTF, GX_CTF_R8 = 0x8 | _GX_TF_CTF, GX_CTF_G8 = 0x9 | _GX_TF_CTF, @@ -42,12 +51,7 @@ enum TextureFormat GX_CTF_RG8 = 0xB | _GX_TF_CTF, GX_CTF_GB8 = 0xC | _GX_TF_CTF, - // Texture formats (which match the color formats above) - GX_TF_Z8 = 0x1 | _GX_TF_ZTF, - GX_TF_Z16 = 0x3 | _GX_TF_ZTF, - GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF, - - // copy only texture formats + // extra depth texture formats that can be used for efb copies. GX_CTF_Z4 = 0x0 | _GX_TF_ZTF | _GX_TF_CTF, GX_CTF_Z8H = 0x8 | _GX_TF_ZTF | _GX_TF_CTF, // This produces an identical result to to GX_TF_Z8 GX_CTF_Z8M = 0x9 | _GX_TF_ZTF | _GX_TF_CTF, -- cgit v1.2.3 From 8ce04f9a65612b7553015428e617ba7c53913175 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 5 Sep 2015 11:44:21 -0400 Subject: General: Replace GC_ALIGN macros with alignas Standard supported alignment -> out with compiler-specific. --- Source/Core/VideoCommon/TextureDecoder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/TextureDecoder.h') diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index be0c8f44e0..249024fa3a 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -12,7 +12,7 @@ enum TMEM_SIZE = 1024 * 1024, TMEM_LINE_SIZE = 32, }; -extern GC_ALIGNED16(u8 texMem[TMEM_SIZE]); +alignas(16) extern u8 texMem[TMEM_SIZE]; enum TextureFormat { -- cgit v1.2.3