Fix OpenGLES 3.0 on Qualcomm's crappy driver, it can't bitshift sometimes.

[fixed lint issues and grammar ~comex]
This commit is contained in:
Dwayne Slater
2015-02-28 15:02:44 -05:00
committed by comex
parent e4b5637c3a
commit ae83a1b821
5 changed files with 171 additions and 20 deletions

View File

@ -5,6 +5,7 @@
#pragma once
#include "VideoCommon/ConstantManager.h"
#include "VideoCommon/DriverDetails.h"
#include "VideoCommon/NativeVertexFormat.h"
#include "VideoCommon/ShaderGenCommon.h"
#include "VideoCommon/XFMemory.h"
@ -250,7 +251,10 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
}
}
object.Write("lacc = clamp(lacc, 0, 255);\n");
object.Write("%s%d = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0;\n", dest, j);
if (DriverDetails::HasBug(DriverDetails::BUG_BROKENIVECSHIFTS))
object.Write("%s%d = float4(irshift((mat * (lacc + irshift(lacc, 7))), 8)) / 255.0;\n", dest, j);
else
object.Write("%s%d = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0;\n", dest, j);
object.Write("}\n");
}
}