diff --git a/src/core/hle/D3D8/Direct3D9/CxbxPixelShaderTemplate.hlsl b/src/core/hle/D3D8/Direct3D9/CxbxPixelShaderTemplate.hlsl index b69b93393..84ea398b4 100644 --- a/src/core/hle/D3D8/Direct3D9/CxbxPixelShaderTemplate.hlsl +++ b/src/core/hle/D3D8/Direct3D9/CxbxPixelShaderTemplate.hlsl @@ -24,7 +24,7 @@ struct PS_OUTPUT // Source register modifier macro's, based on enum PS_INPUTMAPPING : // TODO : Should all these 'max(0, x)' actually be 'saturate(x)'? This, because the operation may actually clamp the register value to the range [0..1] -#define s_sat(x) saturate(x) // PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, // OK for final combiner // Clamps negative x to 0 // Was : max(0, x) +#define s_sat(x) saturate(x) // PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, // OK for final combiner // Clamps negative x to 0 // Was : max(0, x), then abs(x) (Test case: Scaler) #define s_comp(x) (1 - saturate(x)) // PS_INPUTMAPPING_UNSIGNED_INVERT= 0x20L, // OK for final combiner // Complements x (1-x) // Was : 1- min(max(0, x), 1) #define s_bx2(x) (( 2 * max(0, x)) - 1) // PS_INPUTMAPPING_EXPAND_NORMAL= 0x40L, // invalid for final combiner // Shifts range from [0..1] to [-1..1] #define s_negbx2(x) ((-2 * max(0, x)) + 1) // PS_INPUTMAPPING_EXPAND_NEGATE= 0x60L, // invalid for final combiner // Shifts range from [0..1] to [-1..1] and then negates diff --git a/src/core/hle/D3D8/Direct3D9/PixelShader.cpp b/src/core/hle/D3D8/Direct3D9/PixelShader.cpp index d3cd3244e..4a94c54fc 100644 --- a/src/core/hle/D3D8/Direct3D9/PixelShader.cpp +++ b/src/core/hle/D3D8/Direct3D9/PixelShader.cpp @@ -76,7 +76,7 @@ void InputRegisterHLSL(std::stringstream& hlsl, RPSInputRegister &input, unsigne // [*][0] = PS_REGISTER_ZERO-derived constants, based on enum PS_INPUTMAPPING : // [*][1] = Source register modifier macro's, based on enum PS_INPUTMAPPING : // [*][2] = Final combiner source register modifier macro's, based on enum PS_INPUTMAPPING : - "zero", "s_sat", "abs", // saturate(x) // PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, OK for final combiner // Clamps negative x to 0 + "zero", "s_sat", "s_sat", // saturate(x) // PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, OK for final combiner // Clamps negative x to 0 "one", "s_comp", "s_comp", // ( 1.0 - saturate(x) ) // PS_INPUTMAPPING_UNSIGNED_INVERT= 0x20L, OK for final combiner // Complements x (1-x) "-one", "s_bx2", "N/A", // ( 2.0 * max(0.0, x) - 1.0) // PS_INPUTMAPPING_EXPAND_NORMAL= 0x40L, invalid for final combiner // Shifts range from [0..1] to [-1..1] "one", "s_negbx2", "N/A", // (-2.0 * max(0.0, x) + 1.0) // PS_INPUTMAPPING_EXPAND_NEGATE= 0x60L, invalid for final combiner // Shifts range from [0..1] to [-1..1] and then negates