mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
[AArch64] Fix a couple of bugs in the vertex loader
In particular this fixes the 6666 colour format We were loading from the wrong location and it was causing /terrible/ colour changes. This also fixes a bug in the all the colour formats(except 888) where the unaligned path was loading in to the wrong register.
This commit is contained in:
parent
3948dc77c7
commit
a811370329
@ -217,7 +217,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
|
|||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
|
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
|
||||||
else if (offset & 1) // Not aligned - unscaled
|
else if (offset & 1) // Not aligned - unscaled
|
||||||
LDURH(scratch2_reg, src_reg, offset);
|
LDURH(scratch3_reg, src_reg, offset);
|
||||||
else
|
else
|
||||||
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
|
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
|
|||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
|
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
|
||||||
else if (offset & 1) // Not aligned - unscaled
|
else if (offset & 1) // Not aligned - unscaled
|
||||||
LDURH(scratch2_reg, src_reg, offset);
|
LDURH(scratch3_reg, src_reg, offset);
|
||||||
else
|
else
|
||||||
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
|
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
|
||||||
|
|
||||||
@ -284,16 +284,22 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
|
|||||||
// RRRRRRGG GGGGBBBB BBAAAAAA
|
// RRRRRRGG GGGGBBBB BBAAAAAA
|
||||||
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
|
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
LDR(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
|
{
|
||||||
else if (offset & 3) // Not aligned - unscaled
|
LDUR(scratch3_reg, EncodeRegTo64(scratch1_reg), -1);
|
||||||
LDUR(scratch2_reg, src_reg, offset);
|
}
|
||||||
else
|
else
|
||||||
LDR(INDEX_UNSIGNED, scratch3_reg, src_reg, m_src_ofs);
|
{
|
||||||
|
offset -= 1;
|
||||||
|
if (offset & 3) // Not aligned - unscaled
|
||||||
|
LDUR(scratch3_reg, src_reg, offset);
|
||||||
|
else
|
||||||
|
LDR(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
|
||||||
|
}
|
||||||
|
|
||||||
REV32(scratch3_reg, scratch3_reg);
|
REV32(scratch3_reg, scratch3_reg);
|
||||||
|
|
||||||
// A
|
// A
|
||||||
AND(scratch2_reg, scratch3_reg, 32, 5);
|
UBFM(scratch2_reg, scratch3_reg, 0, 5);
|
||||||
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 2));
|
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 2));
|
||||||
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 6));
|
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 6));
|
||||||
ORR(scratch1_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 24));
|
ORR(scratch1_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 24));
|
||||||
@ -316,6 +322,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
|
|||||||
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 4));
|
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 4));
|
||||||
|
|
||||||
STR(INDEX_UNSIGNED, scratch1_reg, dst_reg, m_dst_ofs);
|
STR(INDEX_UNSIGNED, scratch1_reg, dst_reg, m_dst_ofs);
|
||||||
|
|
||||||
load_bytes = 3;
|
load_bytes = 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user