[SPIR-V] Wrap 4-operand ops and 1-3-operand GLSL std calls

This commit is contained in:
Triang3l
2023-04-19 21:44:24 +03:00
parent 19d56001d2
commit 8aaa6f1f7d
7 changed files with 721 additions and 947 deletions

View File

@@ -26,19 +26,22 @@ class SpirvBuilder : public spv::Builder {
// Make public rather than protected.
using spv::Builder::createSelectionMerge;
spv::Id createNoContractionUnaryOp(spv::Op op_code, spv::Id type_id,
spv::Id operand) {
spv::Id result = createUnaryOp(op_code, type_id, operand);
addDecoration(result, spv::DecorationNoContraction);
return result;
}
spv::Id createQuadOp(spv::Op op_code, spv::Id type_id, spv::Id operand1,
spv::Id operand2, spv::Id operand3, spv::Id operand4);
spv::Id createNoContractionUnaryOp(spv::Op op_code, spv::Id type_id,
spv::Id operand);
spv::Id createNoContractionBinOp(spv::Op op_code, spv::Id type_id,
spv::Id operand1, spv::Id operand2) {
spv::Id result = createBinOp(op_code, type_id, operand1, operand2);
addDecoration(result, spv::DecorationNoContraction);
return result;
}
spv::Id operand1, spv::Id operand2);
spv::Id createUnaryBuiltinCall(spv::Id result_type, spv::Id builtins,
int entry_point, spv::Id operand);
spv::Id createBinBuiltinCall(spv::Id result_type, spv::Id builtins,
int entry_point, spv::Id operand1,
spv::Id operand2);
spv::Id createTriBuiltinCall(spv::Id result_type, spv::Id builtins,
int entry_point, spv::Id operand1,
spv::Id operand2, spv::Id operand3);
};
} // namespace gpu