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: Alexis Hétu <sugoi@google.com> Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp index be57e54..214ef1c 100644 --- a/src/Pipeline/SpirvShaderDebugger.cpp +++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -1288,21 +1288,23 @@ } // 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) {