From 0432d8afb17dbf61f9a11ecc757316cf69b320d9 Mon Sep 17 00:00:00 2001 From: Jasper Bekkers Date: Sun, 16 Aug 2020 16:26:50 +0200 Subject: [PATCH] OpSpecConstantOp only supported IdRefs which was incorrect, it just needed to parse parameters as usual. Fixes #121 --- rspirv/binary/parser.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rspirv/binary/parser.rs b/rspirv/binary/parser.rs index 171682fb..79f5e5ba 100644 --- a/rspirv/binary/parser.rs +++ b/rspirv/binary/parser.rs @@ -348,10 +348,11 @@ impl<'c, 'd> Parser<'c, 'd> { if let Some(g) = GInstTable::lookup_opcode(number as u16) { // TODO: check whether this opcode is allowed here. operands.push(dr::Operand::LiteralSpecConstantOpInteger(g.opcode)); - // We need id parameters to this SpecConstantOp. - for operand in g.operands { - if operand.kind == GOpKind::IdRef { - operands.push(dr::Operand::IdRef(self.decoder.id()?)) + + // We need all parameters to this SpecConstantOp. + for loperand in g.operands { + if loperand.kind != GOpKind::IdResultType && loperand.kind != GOpKind::IdResult { + operands.append(&mut self.parse_operand(loperand.kind)?); } } Ok(operands)