From 3cb589639d4beebf4ca6a810b1ab898a2741c0b8 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 27 Aug 2015 13:44:31 -0400 Subject: [PATCH] Add GLSL std450 extended instruction 65-71. --- source/ext_inst.cpp | 9 +++++++++ test/ExtInstGLSLstd450.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/source/ext_inst.cpp b/source/ext_inst.cpp index cc3bae1..a971694 100644 --- a/source/ext_inst.cpp +++ b/source/ext_inst.cpp @@ -72,6 +72,15 @@ static const spv_ext_inst_desc_t glslStd450Entries[] = { {GLSL450Inst2(Frexp)}, {GLSL450Inst1(FrexpStruct)}, {GLSL450Inst2(Ldexp)}, + {GLSL450Inst1(Length)}, + {GLSL450Inst2(Distance)}, + {GLSL450Inst2(Cross)}, + {GLSL450Inst1(Normalize)}, + // clang-format off + {"Faceforward", GLSLstd450::GLSLstd450FaceForward, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}}, + // clang-format on + {GLSL450Inst2(Reflect)}, + {GLSL450Inst3(Refract)}, // TODO: Add remaining GLSL.std.450 instructions }; diff --git a/test/ExtInstGLSLstd450.cpp b/test/ExtInstGLSLstd450.cpp index 96669a3..bcbcaaa 100644 --- a/test/ExtInstGLSLstd450.cpp +++ b/test/ExtInstGLSLstd450.cpp @@ -187,4 +187,14 @@ INSTANTIATE_TEST_CASE_P( {kF32Type, kF32Const, "%4", "Frexp", "%5 %5", 50, 7, {5, 5}}, {kF32Type, kF32Const, "%4", "FrexpStruct", "%5", 51, 6, {5}}, {kF32Type, kF32Const, "%4", "Ldexp", "%5 %5", 52, 7, {5, 5}}, + + {kF32Type, kF32Const, "%4", "Length", "%5", 65, 6, {5}}, + {kF32Type, kF32Const, "%4", "Distance", "%5 %5", 66, 7, {5, 5}}, + {kF32Type, kF32Const, "%4", "Cross", "%5 %5", 67, 7, {5, 5}}, + {kF32Type, kF32Const, "%4", "Normalize", "%5", 68, 6, {5}}, + // clang-format off + {kF32Type, kF32Const, "%4", "Faceforward", "%5 %5 %5", 69, 8, {5, 5, 5}}, + // clang-format on + {kF32Type, kF32Const, "%4", "Reflect", "%5 %5", 70, 7, {5, 5}}, + {kF32Type, kF32Const, "%4", "Refract", "%5 %5 %5", 71, 8, {5, 5, 5}}, }))); -- 2.7.4