case spv::OpAccessChain:
case spv::OpCompositeConstruct:
case spv::OpCompositeInsert:
+ case spv::OpCompositeExtract:
// Instructions that yield an ssavalue.
{
TypeID typeId = insn.word(1);
dst.emplace(i, srcObjectAccess[i]);
break;
}
+ case spv::OpCompositeExtract:
+ {
+ auto &type = getType(insn.word(1));
+ auto &dst = routine->createIntermediate(insn.word(2), type.sizeInComponents);
+ auto &compositeObject = getObject(insn.word(3));
+ TypeID compositeTypeId = compositeObject.definition.word(1);
+ auto firstComponent = WalkLiteralAccessChain(compositeTypeId, insn.wordCount() - 4, insn.wordPointer(4));
+
+ GenericValue compositeObjectAccess(this, routine, insn.word(3));
+ for (auto i = 0u; i < type.sizeInComponents; i++)
+ dst.emplace(i, compositeObjectAccess[firstComponent + i]);
+ break;
+ }
default:
printf("emit: ignoring opcode %d\n", insn.opcode());
break;