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.
This commit is contained in:
Ryan Houdek
2014-12-03 00:29:50 -06:00
parent 22209bcc62
commit 5c3bbf7409
3 changed files with 36 additions and 5 deletions

View File

@ -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)