mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
x64 Shader JIT: Optimize SSE4.1 blending path
Co-Authored-By: Burhan R <53955076+burhanr13@users.noreply.github.com>
This commit is contained in:
parent
72b4194c95
commit
87652bfeda
2 changed files with 5 additions and 6 deletions
|
@ -370,12 +370,11 @@ void ShaderEmitter::storeRegister(Xmm source, const PICAShader& shader, u32 dest
|
||||||
} else if (haveSSE4_1) {
|
} else if (haveSSE4_1) {
|
||||||
// Bit reverse the write mask because that is what blendps expects
|
// Bit reverse the write mask because that is what blendps expects
|
||||||
u32 adjustedMask = ((writeMask >> 3) & 0b1) | ((writeMask >> 1) & 0b10) | ((writeMask << 1) & 0b100) | ((writeMask << 3) & 0b1000);
|
u32 adjustedMask = ((writeMask >> 3) & 0b1) | ((writeMask >> 1) & 0b10) | ((writeMask << 1) & 0b100) | ((writeMask << 3) & 0b1000);
|
||||||
// Don't accidentally overwrite scratch1 if that is what we're writing derp
|
|
||||||
Xmm temp = (source == scratch1) ? scratch2 : scratch1;
|
|
||||||
|
|
||||||
movaps(temp, xword[statePointer + offset]); // Read current value of dest
|
// Blend current value of dest with source. We have to invert the bits of the mask, as we do blendps source, dest instead of dest, source
|
||||||
blendps(temp, source, adjustedMask); // Blend with source
|
// Note: This destroys source
|
||||||
movaps(xword[statePointer + offset], temp); // Write back
|
blendps(source, xword[statePointer + offset], adjustedMask ^ 0xF);
|
||||||
|
movaps(xword[statePointer + offset], source); // Write back
|
||||||
} else {
|
} else {
|
||||||
// Blend algo referenced from Citra
|
// Blend algo referenced from Citra
|
||||||
const u8 selector = (((writeMask & 0b1000) ? 1 : 0) << 0) |
|
const u8 selector = (((writeMask & 0b1000) ? 1 : 0) << 0) |
|
||||||
|
|
|
@ -174,8 +174,8 @@ static void configInit() {
|
||||||
{"panda3ds_use_audio", "Enable audio; disabled|enabled"},
|
{"panda3ds_use_audio", "Enable audio; disabled|enabled"},
|
||||||
{"panda3ds_audio_volume", "Audio volume; 100|0|10|20|40|60|80|90|100|120|140|150|180|200"},
|
{"panda3ds_audio_volume", "Audio volume; 100|0|10|20|40|60|80|90|100|120|140|150|180|200"},
|
||||||
{"panda3ds_mute_audio", "Mute audio; disabled|enabled"},
|
{"panda3ds_mute_audio", "Mute audio; disabled|enabled"},
|
||||||
|
|
||||||
{"panda3ds_enable_aac", "Enable AAC audio; enabled|disabled"},
|
{"panda3ds_enable_aac", "Enable AAC audio; enabled|disabled"},
|
||||||
|
|
||||||
{"panda3ds_ubershader_lighting_override", "Force shadergen when rendering lights; enabled|disabled"},
|
{"panda3ds_ubershader_lighting_override", "Force shadergen when rendering lights; enabled|disabled"},
|
||||||
{"panda3ds_ubershader_lighting_override_threshold", "Light threshold for forcing shadergen; 1|2|3|4|5|6|7|8"},
|
{"panda3ds_ubershader_lighting_override_threshold", "Light threshold for forcing shadergen; 1|2|3|4|5|6|7|8"},
|
||||||
{"panda3ds_use_virtual_sd", "Enable virtual SD card; enabled|disabled"},
|
{"panda3ds_use_virtual_sd", "Enable virtual SD card; enabled|disabled"},
|
||||||
|
|
Loading…
Add table
Reference in a new issue