From e7a5847c304117c45cd1f9012101627043a58e95 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Wed, 10 Apr 2013 14:44:09 +0200 Subject: [PATCH] ShaderGen: Build fix. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 2 +- Source/Core/VideoCommon/Src/ShaderGenCommon.h | 7 +++---- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 4dbb56b320..918b8237d6 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -1211,7 +1211,7 @@ void GetPixelShaderUid(PixelShaderUid& object, DSTALPHA_MODE dstAlphaMode, API_T { PixelShaderCode code; GeneratePixelShaderCode(code, dstAlphaMode, API_OPENGL, components); - CheckForUidMismatch(code, object); + CheckForUidMismatch(code, object, "Pixel", "p"); } } diff --git a/Source/Core/VideoCommon/Src/ShaderGenCommon.h b/Source/Core/VideoCommon/Src/ShaderGenCommon.h index 8356b7defe..5ad20aa3c7 100644 --- a/Source/Core/VideoCommon/Src/ShaderGenCommon.h +++ b/Source/Core/VideoCommon/Src/ShaderGenCommon.h @@ -175,7 +175,7 @@ typedef ShaderUid PixelShaderUid; typedef ShaderUid VertexShaderUid; template -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 s_shaders; static std::vector 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); } } } diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 52c3aeaf30..294e363756 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -528,7 +528,7 @@ void GetVertexShaderUid(VertexShaderUid& object, u32 components, API_TYPE api_ty { VertexShaderCode code; GenerateVertexShaderCode(code, components, API_OPENGL); - CheckForUidMismatch(code, object); + CheckForUidMismatch(code, object, "Vertex", "v"); } }