ShaderGen: Build fix.

This commit is contained in:
NeoBrainX 2013-04-10 14:44:09 +02:00
parent abde070f63
commit e7a5847c30
3 changed files with 5 additions and 6 deletions

View file

@ -1211,7 +1211,7 @@ void GetPixelShaderUid(PixelShaderUid& object, DSTALPHA_MODE dstAlphaMode, API_T
{
PixelShaderCode code;
GeneratePixelShaderCode(code, dstAlphaMode, API_OPENGL, components);
CheckForUidMismatch<PixelShaderUid,PixelShaderCode>(code, object);
CheckForUidMismatch<PixelShaderUid,PixelShaderCode>(code, object, "Pixel", "p");
}
}

View file

@ -175,7 +175,7 @@ typedef ShaderUid<pixel_shader_uid_data> PixelShaderUid;
typedef ShaderUid<vertex_shader_uid_data> VertexShaderUid;
template<class UidT, class CodeT>
void CheckForUidMismatch(CodeT& new_code, const UidT& new_uid)
void CheckForUidMismatch(CodeT& new_code, const UidT& new_uid, const char* shader_type, const char* dump_prefix)
{
static std::map<UidT,std::string> s_shaders;
static std::vector<UidT> s_uids;
@ -196,7 +196,7 @@ void CheckForUidMismatch(CodeT& new_code, const UidT& new_uid)
char szTemp[MAX_PATH];
sprintf(szTemp, "%s%ssuid_mismatch_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(),
(typeid(UidT) == typeid(PixelShaderUid)) ? "p" : (typeid(UidT) == typeid(VertexShaderUid)) ? "v" : "o",
dump_prefix,
++num_failures);
// TODO: Should also dump uids
@ -207,8 +207,7 @@ void CheckForUidMismatch(CodeT& new_code, const UidT& new_uid)
file.close();
// TODO: Make this more idiot-proof
ERROR_LOG(VIDEO, "%s shader uid mismatch!",
(typeid(UidT) == typeid(PixelShaderUid)) ? "Pixel" : (typeid(UidT) == typeid(VertexShaderUid)) ? "Vertex" : "Other");
ERROR_LOG(VIDEO, "%s shader uid mismatch!", shader_type);
}
}
}

View file

@ -528,7 +528,7 @@ void GetVertexShaderUid(VertexShaderUid& object, u32 components, API_TYPE api_ty
{
VertexShaderCode code;
GenerateVertexShaderCode(code, components, API_OPENGL);
CheckForUidMismatch<VertexShaderUid,VertexShaderCode>(code, object);
CheckForUidMismatch<VertexShaderUid,VertexShaderCode>(code, object, "Vertex", "v");
}
}