mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
softjit: Reduce ditherMatrix to 8-bit.
Oops, not sure why I made it 16 bit.
This commit is contained in:
parent
1c5615624a
commit
aec41b34d6
2 changed files with 5 additions and 6 deletions
|
@ -1382,19 +1382,18 @@ bool PixelJitCache::Jit_Dither(const PixelFuncID &id) {
|
|||
MOVSX(32, 8, valueReg, R(valueReg));
|
||||
SAR(8, R(valueReg), Imm8(4));
|
||||
#else
|
||||
// Sum up (x + y * 4) * 2 + ditherMatrix offset to valueReg.
|
||||
SHL(32, R(argXReg), Imm8(1));
|
||||
LEA(32, valueReg, MComplex(argXReg, valueReg, 8, offsetof(PixelFuncID, cached.ditherMatrix)));
|
||||
// Sum up (x + y * 4) + ditherMatrix offset to valueReg.
|
||||
LEA(32, valueReg, MComplex(argXReg, valueReg, 4, offsetof(PixelFuncID, cached.ditherMatrix)));
|
||||
|
||||
// Okay, now abuse argXReg to read the PixelFuncID pointer on the stack.
|
||||
if (regCache_.Has(RegCache::GEN_ARG_ID)) {
|
||||
X64Reg idReg = regCache_.Find(RegCache::GEN_ARG_ID);
|
||||
MOVSX(32, 16, valueReg, MRegSum(idReg, valueReg));
|
||||
MOVSX(32, 8, valueReg, MRegSum(idReg, valueReg));
|
||||
regCache_.Unlock(idReg, RegCache::GEN_ARG_ID);
|
||||
} else {
|
||||
_assert_(stackIDOffset_ != -1);
|
||||
MOV(PTRBITS, R(argXReg), MDisp(RSP, stackIDOffset_));
|
||||
MOVSX(32, 16, valueReg, MRegSum(argXReg, valueReg));
|
||||
MOVSX(32, 8, valueReg, MRegSum(argXReg, valueReg));
|
||||
}
|
||||
#endif
|
||||
if (argXReg != INVALID_REG) {
|
||||
|
|
|
@ -35,7 +35,7 @@ struct PixelFuncID {
|
|||
struct {
|
||||
// Warning: these are not hashed or compared for equal. Just cached values.
|
||||
uint32_t colorWriteMask{};
|
||||
int16_t ditherMatrix[16]{};
|
||||
int8_t ditherMatrix[16]{};
|
||||
} cached;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue