diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index df9133f4d7..f48ac546e8 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -19,11 +19,13 @@ std::string ShaderID::ToDebugString() const { return StringFromFormat("%08x:%08x", d >> 32, d & 0xFFFFFFFF); } -std::string VShaderID::Description() const { +std::string VShaderID::Description(bool includeID) const { char buffer[512]; StringWriter desc(buffer, sizeof(buffer)); - desc.W(ToDebugString()).C(" "); + if (includeID) { + desc.W(ToDebugString()).C(" "); + } if (Bit(VS_BIT_IS_THROUGH)) desc.C("THR "); if (Bit(VS_BIT_USE_HW_TRANSFORM)) desc.C("HWX "); else desc.C("SWX "); if (Bit(VS_BIT_HAS_NORMAL)) desc.C("N "); @@ -176,11 +178,13 @@ static bool MatrixNeedsProjection(const float m[12], GETexProjMapMode mode) { return m[2] != 0.0f || m[5] != 0.0f || (m[8] != 0.0f && mode != GE_PROJMAP_UV) || m[11] != 1.0f; } -std::string FShaderID::Description() const { +std::string FShaderID::Description(bool includeID) const { char buffer[512]; StringWriter desc(buffer, sizeof(buffer)); + if (includeID) { + desc.W(ToDebugString()).C(" "); + } - desc.W(ToDebugString()).C(" "); if (Bit(FS_BIT_CLEARMODE)) desc.C("Clear "); if (Bit(FS_BIT_DO_TEXTURE)) { desc.W(Bit(FS_BIT_3D_TEXTURE) ? "Tex3D" : "Tex"); diff --git a/GPU/Common/ShaderId.h b/GPU/Common/ShaderId.h index a3960acc30..eb206151f6 100644 --- a/GPU/Common/ShaderId.h +++ b/GPU/Common/ShaderId.h @@ -208,7 +208,7 @@ struct VShaderID : public ShaderID { // Generates a compact string that describes the shader. Useful in a list to get an overview // of the current flora of shaders. - std::string Description() const; + std::string Description(bool includeID = true) const; }; struct FShaderID : public ShaderID { @@ -235,7 +235,7 @@ struct FShaderID : public ShaderID { ShaderID::SetBits((int)bit, count, value); } - std::string Description() const; + std::string Description(bool includeID = true) const; }; static_assert(sizeof(VShaderID) == sizeof(uint64_t), "VShaderID size mismatch"); diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index de8cc80534..fba6c8ae60 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -536,10 +536,10 @@ void ShaderListScreen::AddPipelineAnalysis(UI::LinearLayout *tabContent) { if (IsSameExceptForShaders(keyA, keyB)) { // Found a pair of pipelines that are identical except for the shaders. if (keyA.vid != keyB.vid) { - toBeMerged += "VShader: " + keyA.vid.Description() + " vs " + keyB.vid.Description() + "\n"; + toBeMerged += "VShader: " + keyA.vid.Description(false) + " vs " + keyB.vid.Description(false) + "\n"; } if (keyA.fid != keyB.fid) { - toBeMerged += "FShader: " + keyA.fid.Description() + " vs " + keyB.fid.Description() + "\n"; + toBeMerged += "FShader: " + keyA.fid.Description(false) + " vs " + keyB.fid.Description(false) + "\n"; } } if (IsSameExceptForVertexFormat(keyA, keyB)) { @@ -553,8 +553,8 @@ void ShaderListScreen::AddPipelineAnalysis(UI::LinearLayout *tabContent) { } } if (!toBeMerged.empty()) { - tabContent->Add(new UI::TextView(keys[i].GetDescription(SHADER_STRING_SHORT_DESC), FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT, true)); - tabContent->Add(new UI::TextView(toBeMerged, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT, true)); + tabContent->Add(new UI::TextView(keys[i].GetDescription(SHADER_STRING_SHORT_DESC), FLAG_DYNAMIC_ASCII, true)); + tabContent->Add(new UI::TextView(toBeMerged, FLAG_DYNAMIC_ASCII, true)); } } #endif