Fix a vshader id bit collision, avoid color test when set to 'ALWAYS', zeroinitialize dls.

This commit is contained in:
Henrik Rydgard
2013-04-15 22:57:54 +02:00
parent cbbc4e2c9e
commit ea11c36091
4 changed files with 27 additions and 22 deletions

View File

@@ -36,16 +36,14 @@
#define WRITE p+=sprintf
bool CanUseHardwareTransform(int prim)
{
bool CanUseHardwareTransform(int prim) {
if (!g_Config.bHardwareTransform)
return false;
return !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES;
}
// prim so we can special case for RECTANGLES :(
void ComputeVertexShaderID(VertexShaderID *id, int prim)
{
void ComputeVertexShaderID(VertexShaderID *id, int prim) {
int doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear();
bool hasColor = (gstate.vertType & GE_VTYPE_COL_MASK) != 0;
@@ -84,8 +82,8 @@ void ComputeVertexShaderID(VertexShaderID *id, int prim)
// Okay, d[1] coming up. ==============
id->d[1] |= gstate.isLightingEnabled() << 19;
if ((gstate.lightingEnable & 1) || gstate.getUVGenMode() == 2) {
id->d[1] |= gstate.isLightingEnabled() << 24;
if (gstate.isLightingEnabled() || gstate.getUVGenMode() == 2) {
// Light bits
for (int i = 0; i < 4; i++) {
id->d[1] |= (gstate.ltype[i] & 3) << (i * 4);
@@ -99,7 +97,7 @@ void ComputeVertexShaderID(VertexShaderID *id, int prim)
}
}
const char *boneWeightAttrDecl[8] = {
static const char * const boneWeightAttrDecl[8] = {
"attribute float a_weight0123;\n",
"attribute vec2 a_weight0123;\n",
"attribute vec3 a_weight0123;\n",
@@ -110,7 +108,7 @@ const char *boneWeightAttrDecl[8] = {
"attribute vec4 a_weight0123;\nattribute vec4 a_weight4567;\n",
};
const char *boneWeightAttr[8] = {
static const char * const boneWeightAttr[8] = {
"a_weight0123.x",
"a_weight0123.y",
"a_weight0123.z",