From 8d9cf9fdce10f3bda3fb2a263c6eab0e08563bfc Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Mon, 1 Apr 2024 19:15:46 +0100 Subject: [PATCH] Pixel History UI always show alpha for Shader Out --- qrenderdoc/Windows/PixelHistoryView.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index 8ac14b8e7..847273f39 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -310,7 +310,7 @@ public: } if(mod.directShaderWrite) return tr("Tex Before\n\n") + modString(mod.preMod); - return tr("Shader Out\n\n") + modString(mod.shaderOut); + return tr("Shader Out\n\n") + modString(mod.shaderOut, true); } } @@ -537,7 +537,7 @@ private: (int)(255.0f * b + 0.5f))); } - QString modString(const ModificationValue &val) const + QString modString(const ModificationValue &val, bool forceShowAlpha = false) const { QString s; @@ -565,6 +565,21 @@ private: for(int i = 0; i < numComps; i++) s += colourLetterPrefix[i] + Formatter::Format(val.col.floatValue[i]) + lit("\n"); } + if(forceShowAlpha && numComps < 4) + { + if(m_IsUint) + { + s += colourLetterPrefix[3] + Formatter::Format(val.col.uintValue[3]) + lit("\n"); + } + else if(m_IsSint) + { + s += colourLetterPrefix[3] + Formatter::Format(val.col.intValue[3]) + lit("\n"); + } + else + { + s += colourLetterPrefix[3] + Formatter::Format(val.col.floatValue[3]) + lit("\n"); + } + } } if(val.depth >= 0.0f)