summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2014-12-03 00:29:50 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2014-12-03 00:33:42 -0600
commit5c3bbf74094135b92a3f912eb67cace29676dcc3 (patch)
tree3471cde08698797f197310e0866d1b12adcd6bf3 /Source/Core/VideoCommon/PixelShaderGen.cpp
parent22209bcc62fb30b6c8f047876d82b3ec7e4279ec (diff)
Works around broken Intel Windows video drivers.
Just use regular boolean negation in our pixel shader's depth test everywhere except on Qualcomm. This works around a bug in the Intel Windows driver where comparing a boolean value against true or false fails but boolean negation works fine. Quite silly. Should fix issues #7830 and #7899.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 71e534df0a..ae27c3f586 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -13,6 +13,7 @@
#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/ConstantManager.h"
+#include "VideoCommon/DriverDetails.h"
#include "VideoCommon/LightingShaderGen.h"
#include "VideoCommon/NativeVertexFormat.h"
#include "VideoCommon/PixelShaderGen.h"
@@ -981,10 +982,10 @@ static inline void WriteAlphaTest(T& out, pixel_shader_uid_data* uid_data, API_T
out.SetConstantsUsed(C_ALPHA, C_ALPHA);
- // This outputted if statement is not like 'if(!(cond))' for a reason.
- // Qualcomm's v95 drivers produce incorrect code using logical not
- // Checking against false produces the correct code.
- out.Write("\tif(( ");
+ if (DriverDetails::HasBug(DriverDetails::BUG_BROKENNEGATEDBOOLEAN))
+ out.Write("\tif(( ");
+ else
+ out.Write("\tif(!( ");
uid_data->alpha_test_comp0 = bpmem.alpha_test.comp0;
uid_data->alpha_test_comp1 = bpmem.alpha_test.comp1;
@@ -999,7 +1000,11 @@ static inline void WriteAlphaTest(T& out, pixel_shader_uid_data* uid_data, API_T
// Lookup the second component from the alpha function table
compindex = bpmem.alpha_test.comp1;
out.Write(tevAlphaFuncsTable[compindex], alphaRef[1]);
- out.Write(") == false) {\n");
+
+ if (DriverDetails::HasBug(DriverDetails::BUG_BROKENNEGATEDBOOLEAN))
+ out.Write(") == false) {\n");
+ else
+ out.Write(")) {\n");
out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n");
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)