SPV: Fix missing 'Member' operand to OpArrayLength.

This commit is contained in:
John Kessenich
2015-09-21 21:50:29 -06:00
parent 142d7780a4
commit ee21fc9081
5 changed files with 18 additions and 4 deletions

View File

@@ -890,6 +890,16 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, std::vector<Id
return chain->getResultId();
}
Id Builder::createArrayLength(Id base, unsigned int member)
{
Instruction* length = new Instruction(getUniqueId(), makeIntType(32), OpArrayLength);
length->addIdOperand(base);
length->addImmediateOperand(member);
buildPoint->addInstruction(length);
return length->getResultId();
}
Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
{
Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract);