SpirvShaderDebugger: Show vector elements as xyzw
In-memory data visualizations of vector types were using indices
for displaying vector elements. For non-memory data, we use
.x .y .z .w for vectors <= 4 elements.
Mirror this for in-memory data.
Bug: b/148401179
Change-Id: Ib2e8e2019ab274dfae2d6e18978f41c721c800a1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/45609
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp
index 021c240..795fd78 100644
--- a/src/Pipeline/SpirvShaderDebugger.cpp
+++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -439,7 +439,7 @@
{
auto offset = elSize * i * (interleaved ? sw::SIMD::Width : 1);
auto elPtr = static_cast<uint8_t *>(ptr) + offset;
- auto elKey = tostring(i);
+ auto elKey = (components > 4) ? tostring(i) : &"x\0y\0z\0w\0"[i * 2];
# if DEBUG_ANNOTATE_VARIABLE_KEYS
elKey += " (" + tostring(elPtr) + " +" + tostring(offset) + ")" + (interleaved ? "I" : "F");
# endif