Commit e8b6cf63 by Jaebaek Seo

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: 's avatarJaebaek Seo <jaebaek@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 612ded06
...@@ -1790,7 +1790,7 @@ void SpirvShader::Impl::Debugger::process(const InsnIterator &insn, EmitState *s ...@@ -1790,7 +1790,7 @@ void SpirvShader::Impl::Debugger::process(const InsnIterator &insn, EmitState *s
auto idx = shader->GetConstScalarInt(insn.word(i)); auto idx = shader->GetConstScalarInt(insn.word(i));
value->indexes.push_back(idx); value->indexes.push_back(idx);
auto it = node->children.find(i); auto it = node->children.find(idx);
if(it != node->children.end()) if(it != node->children.end())
{ {
node = it->second.get(); node = it->second.get();
...@@ -1800,7 +1800,7 @@ void SpirvShader::Impl::Debugger::process(const InsnIterator &insn, EmitState *s ...@@ -1800,7 +1800,7 @@ void SpirvShader::Impl::Debugger::process(const InsnIterator &insn, EmitState *s
auto parent = node; auto parent = node;
auto child = std::make_unique<debug::LocalVariable::ValueNode>(); auto child = std::make_unique<debug::LocalVariable::ValueNode>();
node = child.get(); node = child.get();
parent->children.emplace(i, std::move(child)); parent->children.emplace(idx, std::move(child));
} }
} }
......
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