mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
rsx/fp: Handle signed operator precedence
This was marked TODO for a long time - Unsigned remap seems to be overriden by gamma mask (Resistance 3) - We already know sign mask overrides gamma mask from UE3 titles
This commit is contained in:
parent
6781373727
commit
a5e455d8ed
1 changed files with 9 additions and 4 deletions
|
@ -1987,11 +1987,16 @@ namespace rsx
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special operations applied to 8-bit formats such as gamma correction and sign conversion
|
// 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
|
// 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)
|
// Precedence = SIGNED override > GAMMA > UNSIGNED_REMAP (See Resistance 3 for GAMMA/REMAP relationship, UE3 for REMAP effect)
|
||||||
u32 argb8_convert = tex.gamma();
|
|
||||||
if (const u32 sign_convert = tex.unsigned_remap() ? 0xF : tex.argb_signed())
|
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
|
// 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
|
// TODO: Use actual remap mask to account for 0 and 1 overrides in default mapping
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue