Skip to content

Commit

Permalink
OpSpecConstantOp only supported IdRefs which was incorrect, it just n…
Browse files Browse the repository at this point in the history
…eeded to parse parameters as usual. Fixes #121 (#151)
  • Loading branch information
Jasper-Bekkers authored Aug 19, 2020
1 parent 0e1ab75 commit 0ceeace
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rspirv/binary/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ceeace

Please sign in to comment.