Commit d68844f4 by Ben Clayton

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: 's avatarAntonio Maiorano <amaiorano@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent 3011de5d
...@@ -439,7 +439,7 @@ struct VectorType : ObjectImpl<VectorType, Type, Object::Kind::VectorType> ...@@ -439,7 +439,7 @@ struct VectorType : ObjectImpl<VectorType, Type, Object::Kind::VectorType>
{ {
auto offset = elSize * i * (interleaved ? sw::SIMD::Width : 1); auto offset = elSize * i * (interleaved ? sw::SIMD::Width : 1);
auto elPtr = static_cast<uint8_t *>(ptr) + offset; 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 # if DEBUG_ANNOTATE_VARIABLE_KEYS
elKey += " (" + tostring(elPtr) + " +" + tostring(offset) + ")" + (interleaved ? "I" : "F"); elKey += " (" + tostring(elPtr) + " +" + tostring(offset) + ")" + (interleaved ? "I" : "F");
# endif # endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment