diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index c1de503b7d..3726b81fc9 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -1987,11 +1987,16 @@ namespace rsx } // Special operations applied to 8-bit formats such as gamma correction and sign conversion - // NOTE: The unsigned_remap being set to anything other than 0 flags the texture as being signed + // NOTE: The unsigned_remap being set to anything other than 0 flags the texture as being signed (UE3) // This is a separate method of setting the format to signed mode without doing so per-channel - // NOTE2: Modifier precedence is not respected here. This is another TODO (kd-11) - u32 argb8_convert = tex.gamma(); - if (const u32 sign_convert = tex.unsigned_remap() ? 0xF : tex.argb_signed()) + // Precedence = SIGNED override > GAMMA > UNSIGNED_REMAP (See Resistance 3 for GAMMA/REMAP relationship, UE3 for REMAP effect) + + const u32 argb8_signed = tex.argb_signed(); + const u32 gamma = tex.gamma() & ~argb8_signed; + const u32 unsigned_remap = (tex.unsigned_remap() == CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL)? 0u : (~gamma & 0xF); + u32 argb8_convert = gamma; + + if (const u32 sign_convert = (argb8_signed | unsigned_remap)) { // Apply remap to avoid mapping 1 to -1. Only the sign conversion needs this check // TODO: Use actual remap mask to account for 0 and 1 overrides in default mapping