diff options
| author | Dentomologist <dentomologist@gmail.com> | 2022-06-13 13:07:20 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2022-07-08 00:19:05 -0700 |
| commit | 0fac1d6e87990a732916b107ec836ca3b0f0e393 (patch) | |
| tree | 16a9c69fe4ef7ca1eb01bd032657b0301185b7fe /Source/Core/VideoCommon/TextureConversionShader.cpp | |
| parent | 7cc89f5642cab3b91aef1c8255af857a1607ddf6 (diff) | |
VideoCommon: Fix D3D shader warning X3571 (negative base for pow())
Add abs() to fix "pow(f, e) will not work for negative f, use abs(f) or
conditionally handle negative values if you expect them".
Diffstat (limited to 'Source/Core/VideoCommon/TextureConversionShader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureConversionShader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp index 19f2a384f0..2c53250cea 100644 --- a/Source/Core/VideoCommon/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/TextureConversionShader.cpp @@ -749,8 +749,8 @@ static void WriteXFBEncoder(ShaderCode& code, APIType api_type, const EFBCopyPar WriteSampleColor(code, "rgb", "color1", 1, api_type, params); // Gamma is only applied to XFB copies. - code.Write(" color0 = pow(color0, float3(gamma_rcp, gamma_rcp, gamma_rcp));\n" - " color1 = pow(color1, float3(gamma_rcp, gamma_rcp, gamma_rcp));\n"); + code.Write(" color0 = pow(abs(color0), float3(gamma_rcp, gamma_rcp, gamma_rcp));\n" + " color1 = pow(abs(color1), float3(gamma_rcp, gamma_rcp, gamma_rcp));\n"); // Convert to YUV. code.Write(" const float3 y_const = float3(0.257, 0.504, 0.098);\n" |
