|
@@ -146,6 +146,7 @@ SpirvCompositeExtract *SpirvBuilder::createCompositeExtract(
|
|
assert(insertPoint && "null insert point");
|
|
assert(insertPoint && "null insert point");
|
|
auto *instruction = new (context)
|
|
auto *instruction = new (context)
|
|
SpirvCompositeExtract(resultType, /*id*/ 0, loc, composite, indexes);
|
|
SpirvCompositeExtract(resultType, /*id*/ 0, loc, composite, indexes);
|
|
|
|
+ instruction->setRValue();
|
|
insertPoint->addInstruction(instruction);
|
|
insertPoint->addInstruction(instruction);
|
|
return instruction;
|
|
return instruction;
|
|
}
|
|
}
|
|
@@ -167,6 +168,7 @@ SpirvVectorShuffle *SpirvBuilder::createVectorShuffle(
|
|
assert(insertPoint && "null insert point");
|
|
assert(insertPoint && "null insert point");
|
|
auto *instruction = new (context) SpirvVectorShuffle(
|
|
auto *instruction = new (context) SpirvVectorShuffle(
|
|
resultType, /*id*/ 0, loc, vector1, vector2, selectors);
|
|
resultType, /*id*/ 0, loc, vector1, vector2, selectors);
|
|
|
|
+ instruction->setRValue();
|
|
insertPoint->addInstruction(instruction);
|
|
insertPoint->addInstruction(instruction);
|
|
return instruction;
|
|
return instruction;
|
|
}
|
|
}
|
|
@@ -210,6 +212,7 @@ SpirvBuilder::createFunctionCall(QualType returnType, SpirvFunction *func,
|
|
assert(insertPoint && "null insert point");
|
|
assert(insertPoint && "null insert point");
|
|
auto *instruction =
|
|
auto *instruction =
|
|
new (context) SpirvFunctionCall(returnType, /*id*/ 0, loc, func, params);
|
|
new (context) SpirvFunctionCall(returnType, /*id*/ 0, loc, func, params);
|
|
|
|
+ instruction->setRValue();
|
|
insertPoint->addInstruction(instruction);
|
|
insertPoint->addInstruction(instruction);
|
|
return instruction;
|
|
return instruction;
|
|
}
|
|
}
|
|
@@ -743,6 +746,17 @@ void SpirvBuilder::createEndPrimitive(SourceLocation loc) {
|
|
insertPoint->addInstruction(inst);
|
|
insertPoint->addInstruction(inst);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+SpirvArrayLength *SpirvBuilder::createArrayLength(QualType resultType,
|
|
|
|
+ SourceLocation loc,
|
|
|
|
+ SpirvInstruction *structure,
|
|
|
|
+ uint32_t arrayMember) {
|
|
|
|
+ assert(insertPoint && "null insert point");
|
|
|
|
+ auto *inst = new (context) SpirvArrayLength(resultType, /*result-id*/ 0, loc,
|
|
|
|
+ structure, arrayMember);
|
|
|
|
+ insertPoint->addInstruction(inst);
|
|
|
|
+ return inst;
|
|
|
|
+}
|
|
|
|
+
|
|
void SpirvBuilder::addExtension(Extension ext, llvm::StringRef target,
|
|
void SpirvBuilder::addExtension(Extension ext, llvm::StringRef target,
|
|
SourceLocation loc) {
|
|
SourceLocation loc) {
|
|
// TODO: The extension management should be removed from here and added as a
|
|
// TODO: The extension management should be removed from here and added as a
|