Commit ea66320c by Ben Clayton

SpirvShader: Fix ASSERT firing in debugger

https://swiftshader-review.googlesource.com/c/SwiftShader/+/43693 added an assert to SpirvShader::Operand that checks the object is a constant or an intermediate. SpirvShader::Impl::Debugger::exposeVariable() was constructing an Operand for pointer object types (but was not using it), firing this assert. Bug: b/129000021 Bug: b/148401179 Change-Id: Id22a92e28b1bb16781b98979d26180b1c022db96 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44014 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent d25ce872
......@@ -1288,21 +1288,23 @@ void SpirvShader::Impl::Debugger::exposeVariable(
}
// No debug type information. Derive from SPIR-V.
Operand val(shader, state, id);
switch(shader->getType(obj).opcode())
{
case spv::OpTypeInt:
{
Operand val(shader, state, id);
group.put<Key, int>(key, Extract(val.Int(0), l));
}
break;
case spv::OpTypeFloat:
{
Operand val(shader, state, id);
group.put<Key, float>(key, Extract(val.Float(0), l));
}
break;
case spv::OpTypeVector:
{
Operand val(shader, state, id);
auto count = shader->getType(obj).definition.word(3);
switch(count)
{
......
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