Fix for bit reduction regression in GX_TF_RGB565 textures from previous commit.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6726 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ecf92f5c3c
commit
b7f7a248c5
|
@ -1311,27 +1311,26 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
// where hg, fe, ba, and dc are 16-bit colors in big-endian order
|
||||
const __m128i rgb565x4 = _mm_loadl_epi64(dxtsrc);
|
||||
|
||||
// The big-endian 16-bit colors `ba` and `dc` look like 0b_RRRrrGGG_gggBBBbb in a little endian xmm register
|
||||
// Unpack `hgfe dcba` to `hhgg ffee ddcc bbaa`, where each 32-bit word is now 0b_RRRrrGGG_gggBBBbb_RRRrrGGG_gggBBBbb
|
||||
const __m128i c0 = _mm_unpacklo_epi8(rgb565x4, rgb565x4);
|
||||
// The big-endian 16-bit colors `ba` and `dc` look like 0b_gggBBBbb_RRRrrGGg in a little endian xmm register
|
||||
// Unpack `hgfe dcba` to `hhgg ffee ddcc bbaa`, where each 32-bit word is now 0b_gggBBBbb_RRRrrGGg_gggBBBbb_RRRrrGGg
|
||||
const __m128i c0 = _mm_unpacklo_epi16(rgb565x4, rgb565x4);
|
||||
|
||||
// swizzle 0b_RRRrrGGg_gggBBBbb_RRRrrGGg_gggBBBbb
|
||||
// swizzle 0b_gggBBBbb_RRRrrGGg_gggBBBbb_RRRrrGGg
|
||||
// to 0b_11111111_BBBbbBBB_GGggggGG_RRRrrRRR
|
||||
|
||||
// 0b_RRRrrGGg_gggBBBbb_RRRrrGGg_gggBBBbb >> 8 [32] =
|
||||
// 0b_00000000_RRRrrGGg_gggBBBbb_RRRrrGGg &
|
||||
// 0b_gggBBBbb_RRRrrGGg_gggBBBbb_RRRrrGGg &
|
||||
// 0b_00000000_00000000_00000000_11111000 =
|
||||
// 0b_00000000_00000000_00000000_RRRrr000
|
||||
const __m128i r0 = _mm_and_si128(_mm_srli_epi32(c0, 8), kMaskR0);
|
||||
const __m128i r0 = _mm_and_si128(c0, kMaskR0);
|
||||
// 0b_00000000_00000000_00000000_RRRrr000 >> 5 [32] =
|
||||
// 0b_00000000_00000000_00000000_00000RRR
|
||||
const __m128i r1 = _mm_srli_epi32(r0, 5);
|
||||
|
||||
// 0b_RRRrrGGg_gggBBBbb_RRRrrGGg_gggBBBbb << 5 [32] =
|
||||
// 0b_GGggggBB_BbbRRRrr_GGggggBB_Bbb00000 &
|
||||
// 0b_gggBBBbb_RRRrrGGg_gggBBBbb_RRRrrGGg >> 3 [32] =
|
||||
// 0b_000gggBB_BbbRRRrr_GGggggBB_BbbRRRrr &
|
||||
// 0b_00000000_00000000_11111100_00000000 =
|
||||
// 0b_00000000_00000000_GGgggg00_00000000
|
||||
const __m128i gtmp = _mm_slli_epi32(c0, 5);
|
||||
const __m128i gtmp = _mm_srli_epi32(c0, 3);
|
||||
const __m128i g0 = _mm_and_si128(gtmp, kMaskG0);
|
||||
// 0b_GGggggBB_BbbRRRrr_GGggggBB_Bbb00000 >> 6 [32] =
|
||||
// 0b_000000GG_ggggBBBb_bRRRrrGG_ggggBBBb &
|
||||
|
@ -1339,11 +1338,11 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
// 0b_00000000_00000000_000000GG_00000000 =
|
||||
const __m128i g1 = _mm_and_si128(_mm_srli_epi32(gtmp, 6), kMaskG1);
|
||||
|
||||
// 0b_RRRrrGGg_gggBBBbb_RRRrrGGg_gggBBBbb << 3 [32] =
|
||||
// 0b_rrGGgggg_BBBbbRRR_rrGGgggg_BBBbb000 &
|
||||
// 0b_gggBBBbb_RRRrrGGg_gggBBBbb_RRRrrGGg >> 5 [32] =
|
||||
// 0b_00000ggg_BBBbbRRR_rrGGgggg_BBBbbRRR &
|
||||
// 0b_00000000_11111000_00000000_00000000 =
|
||||
// 0b_00000000_BBBbb000_00000000_00000000
|
||||
const __m128i b0 = _mm_and_si128(_mm_slli_epi32(c0, 3), kMaskB0);
|
||||
const __m128i b0 = _mm_and_si128(_mm_srli_epi32(c0, 5), kMaskB0);
|
||||
// 0b_00000000_BBBbb000_00000000_00000000 >> 5 [16] =
|
||||
// 0b_00000000_00000BBB_00000000_00000000
|
||||
const __m128i b1 = _mm_srli_epi16(b0, 5);
|
||||
|
|
Loading…
Reference in New Issue