#include <string.h>
-#define GL450Inst(name) #name, GLSLstd450::GLSLstd450##name
+#define GL450InstWithOneIdParam(name) \
+ #name, GLSLstd450::GLSLstd450##name, { SPV_OPERAND_TYPE_ID }
+#define GL450InstWithTwoIdParam(name) \
+ #name, GLSLstd450::GLSLstd450##name, { \
+ SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID \
+ }
+#define GL450InstWithThreeIdParam(name) \
+ #name, GLSLstd450::GLSLstd450##name, { \
+ SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID \
+ }
static const spv_ext_inst_desc_t glslStd450Entries[] = {
- { GL450Inst(Round), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(RoundEven), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Trunc), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(FAbs), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SAbs), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(FSign), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SSign), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Floor), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Ceil), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Fract), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Radians), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Degrees), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Sin), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Cos), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Tan), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Asin), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Acos), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Atan), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Sinh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Cosh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Tanh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Asinh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Acosh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Atanh), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Atan2), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Pow), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Exp), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Log), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Exp2), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Log2), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Sqrt), {SPV_OPERAND_TYPE_ID}, },
- { "Inversesqrt", GLSLstd450::GLSLstd450InverseSqrt, {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Determinant), {SPV_OPERAND_TYPE_ID}, },
- { "Inverse", GLSLstd450::GLSLstd450MatrixInverse, {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Modf), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(ModfStruct), {SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(FMin), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(UMin), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SMin), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(FMax), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(UMax), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SMax), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(FClamp), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(UClamp), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SClamp), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Mix), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(Step), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
- { GL450Inst(SmoothStep), {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, },
+ {GL450InstWithOneIdParam(Round)},
+ {GL450InstWithOneIdParam(RoundEven)},
+ {GL450InstWithOneIdParam(Trunc)},
+ {GL450InstWithOneIdParam(FAbs)},
+ {GL450InstWithOneIdParam(SAbs)},
+ {GL450InstWithOneIdParam(FSign)},
+ {GL450InstWithOneIdParam(SSign)},
+ {GL450InstWithOneIdParam(Floor)},
+ {GL450InstWithOneIdParam(Ceil)},
+ {GL450InstWithOneIdParam(Fract)},
+ {GL450InstWithOneIdParam(Radians)},
+ {GL450InstWithOneIdParam(Degrees)},
+ {GL450InstWithOneIdParam(Sin)},
+ {GL450InstWithOneIdParam(Cos)},
+ {GL450InstWithOneIdParam(Tan)},
+ {GL450InstWithOneIdParam(Asin)},
+ {GL450InstWithOneIdParam(Acos)},
+ {GL450InstWithOneIdParam(Atan)},
+ {GL450InstWithOneIdParam(Sinh)},
+ {GL450InstWithOneIdParam(Cosh)},
+ {GL450InstWithOneIdParam(Tanh)},
+ {GL450InstWithOneIdParam(Asinh)},
+ {GL450InstWithOneIdParam(Acosh)},
+ {GL450InstWithOneIdParam(Atanh)},
+ {GL450InstWithTwoIdParam(Atan2)},
+ {GL450InstWithTwoIdParam(Pow)},
+ {GL450InstWithOneIdParam(Exp)},
+ {GL450InstWithOneIdParam(Log)},
+ {GL450InstWithOneIdParam(Exp2)},
+ {GL450InstWithOneIdParam(Log2)},
+ {GL450InstWithOneIdParam(Sqrt)},
+ // clang-format off
+ {"Inversesqrt", GLSLstd450::GLSLstd450InverseSqrt, {SPV_OPERAND_TYPE_ID}},
+ {GL450InstWithOneIdParam(Determinant)},
+ {"Inverse", GLSLstd450::GLSLstd450MatrixInverse, {SPV_OPERAND_TYPE_ID}},
+ // clang-format on
+ {GL450InstWithTwoIdParam(Modf)},
+ {GL450InstWithOneIdParam(ModfStruct)},
+ {GL450InstWithTwoIdParam(FMin)},
+ {GL450InstWithTwoIdParam(UMin)},
+ {GL450InstWithTwoIdParam(SMin)},
+ {GL450InstWithTwoIdParam(FMax)},
+ {GL450InstWithTwoIdParam(UMax)},
+ {GL450InstWithTwoIdParam(SMax)},
+ {GL450InstWithThreeIdParam(FClamp)},
+ {GL450InstWithThreeIdParam(UClamp)},
+ {GL450InstWithThreeIdParam(SClamp)},
+ {GL450InstWithThreeIdParam(Mix)},
+ {GL450InstWithTwoIdParam(Step)},
+ // clang-format off
+ {"Smoothstep", GLSLstd450::GLSLstd450SmoothStep, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}},
+ // clang-format on
// TODO: Add remaining GLSL.std.450 instructions
};