SpirvShaderDebugger: Correct member index for DebugValue

For DebugValue with index parameter, the debugger code does not use the
correct member index. It results in "undefined" value even when the
shader actually provide the value.

Bug: b/148401179
Change-Id: Ic563db74503200c1a6dc71a5e1744b75df63d610
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50072
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Jaebaek Seo <jaebaek@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp
index 2280fa0..aa20743 100644
--- a/src/Pipeline/SpirvShaderDebugger.cpp
+++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -1790,7 +1790,7 @@
 					auto idx = shader->GetConstScalarInt(insn.word(i));
 					value->indexes.push_back(idx);
 
-					auto it = node->children.find(i);
+					auto it = node->children.find(idx);
 					if(it != node->children.end())
 					{
 						node = it->second.get();
@@ -1800,7 +1800,7 @@
 						auto parent = node;
 						auto child = std::make_unique<debug::LocalVariable::ValueNode>();
 						node = child.get();
-						parent->children.emplace(i, std::move(child));
+						parent->children.emplace(idx, std::move(child));
 					}
 				}