Add GLSL std450 extended instruction 65-71.
authorLei Zhang <antiagainst@google.com>
Thu, 27 Aug 2015 17:44:31 +0000 (13:44 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:52:01 +0000 (12:52 -0400)
source/ext_inst.cpp
test/ExtInstGLSLstd450.cpp

index cc3bae1..a971694 100644 (file)
@@ -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
 };
 
index 96669a3..bcbcaaa 100644 (file)
@@ -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}},
     })));