Add an assert that ID operands are non-zero
Zero is not a valid ID value and the SPIR-V emitter library should never be emitting instructions with ID values of 0.
This commit is contained in:
parent
d89c0b1d13
commit
3ebb72cc74
1 changed files with 2 additions and 0 deletions
|
|
@ -97,6 +97,8 @@ public:
|
|||
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
|
||||
virtual ~Instruction() {}
|
||||
void addIdOperand(Id id) {
|
||||
// ids can't be 0
|
||||
assert(id);
|
||||
operands.push_back(id);
|
||||
idOperand.push_back(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue