diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc index 45f6b35f4d..c3c12f2089 100644 --- a/src/tint/reader/spirv/function.cc +++ b/src/tint/reader/spirv/function.cc @@ -4075,6 +4075,12 @@ TypedExpression FunctionEmitter::EmitGlslStd450ExtInst(const spvtools::opt::Inst // All parameters to GLSL.std.450 extended instructions are IDs. for (uint32_t iarg = 2; iarg < inst.NumInOperands(); ++iarg) { TypedExpression operand = MakeOperand(inst, iarg); + if (!operand.expr) { + if (!failed()) { + Fail() << "unexpected failure to make an operand"; + } + return {}; + } if (first_operand_type == nullptr) { first_operand_type = operand.type; } diff --git a/src/tint/reader/spirv/parser_impl.cc b/src/tint/reader/spirv/parser_impl.cc index 6f6bf1e5a0..220ccb9f1e 100644 --- a/src/tint/reader/spirv/parser_impl.cc +++ b/src/tint/reader/spirv/parser_impl.cc @@ -1891,8 +1891,6 @@ TypedExpression ParserImpl::MakeConstantExpression(uint32_t id) { } auto source = GetSourceForInst(inst); - // TODO(dneto): Handle spec constants too? - auto* original_ast_type = ConvertType(inst->type_id()); if (original_ast_type == nullptr) { return {}; @@ -1952,6 +1950,12 @@ TypedExpression ParserImpl::MakeConstantExpression(uint32_t id) { declared_constant_composites_.insert({id, decl->name->symbol}); return {original_ast_type, builder_.Expr(name)}; } + case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantOp: { + // TODO(crbug.com/tint/111): Handle OpSpecConstantOp and OpSpecConstantComposite here. + Fail() << "unimplemented: OpSpecConstantOp and OpSpecConstantComposite"; + return {}; + } default: break; }