GL_EXT_mesh_shader/SPV_EXT_mesh_shader implementation
[platform/upstream/glslang.git] / gtests / Spv.FromFile.cpp
index 80ce0b1..0f3cd0c 100644 (file)
@@ -69,6 +69,7 @@ using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithPara
 using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
 using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
 using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
+using CompileToSpirv16Test = GlslangTest<::testing::TestWithParam<std::string>>;
 using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
 using VulkanSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
 using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
@@ -77,6 +78,7 @@ using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
 using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
 using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
 using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
+using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
 using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
 
 // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
@@ -121,6 +123,13 @@ TEST_P(CompileToSpirv14Test, FromFile)
                             Target::Spv);
 }
 
+TEST_P(CompileToSpirv16Test, FromFile)
+{
+    loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
+                            Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_3, glslang::EShTargetSpv_1_6,
+                            Target::Spv);
+}
+
 // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully
 // generate SPIR-V.
 TEST_P(CompileOpenGLToSpirvTest, FromFile)
@@ -204,6 +213,13 @@ TEST_P(CompileVulkanToSpirvTestNV, FromFile)
                             Target::Spv);
 }
 
+TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
+{
+    loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
+                            Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
+                            Target::Spv);
+}
+
 TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
 {
     loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
@@ -242,6 +258,7 @@ INSTANTIATE_TEST_SUITE_P(
         "rayQuery-initialization.Error.comp",
         "rayQuery-global.rgen",
         "rayQuery-types.comp",
+        "rayQuery-OpConvertUToAccelerationStructureKHR.comp",
         "spv.set.vert",
         "spv.double.comp",
         "spv.100ops.frag",
@@ -364,6 +381,8 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.intrinsicsSpirvLiteral.vert",
         "spv.intrinsicsSpirvStorageClass.rchit",
         "spv.intrinsicsSpirvType.rgen",
+        "spv.intrinsicsSpirvTypeLocalVar.vert",
+        "spv.invariantAll.vert",
         "spv.layer.tese",
         "spv.layoutNested.vert",
         "spv.length.frag",
@@ -426,6 +445,7 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.textureBuffer.vert",
         "spv.image.frag",
         "spv.imageAtomic64.frag",
+        "spv.imageAtomic64.comp",
         "spv.types.frag",
         "spv.uint.frag",
         "spv.uniformArray.frag",
@@ -466,6 +486,9 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.smBuiltins.frag",
         "spv.builtin.PrimitiveShadingRateEXT.vert",
         "spv.builtin.ShadingRateEXT.frag",
+        "spv.atomicAdd.bufferReference.comp",
+        "spv.fragmentShaderBarycentric3.frag",
+        "spv.fragmentShaderBarycentric4.frag",
     })),
     FileNameAsCustomTestSuffix
 );
@@ -509,6 +532,7 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.vulkan110.int16.frag",
         "spv.int32.frag",
         "spv.explicittypes.frag",
+        "spv.float16NoRelaxed.vert",
         "spv.float32.frag",
         "spv.float64.frag",
         "spv.memoryScopeSemantics.comp",
@@ -606,12 +630,37 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.WorkgroupMemoryExplicitLayout.std140.comp",
         "spv.WorkgroupMemoryExplicitLayout.std430.comp",
         "spv.WorkgroupMemoryExplicitLayout.scalar.comp",
+
+        // SPV_EXT_mesh_shader
+        "spv.ext.meshShaderBuiltins.mesh",
+        "spv.ext.meshShaderRedeclBuiltins.mesh",
+        "spv.ext.meshShaderTaskMem.mesh",
+        "spv.ext.meshShaderUserDefined.mesh",
+        "spv.ext.meshTaskShader.task",
+        "spv.atomiAddEXT.error.mesh",
+        "spv.atomiAddEXT.task",
+        "spv.460.subgroupEXT.task",
+        "spv.460.subgroupEXT.mesh",
     })),
     FileNameAsCustomTestSuffix
 );
 
 // clang-format off
 INSTANTIATE_TEST_SUITE_P(
+    Glsl, CompileToSpirv16Test,
+    ::testing::ValuesIn(std::vector<std::string>({
+        "spv.1.6.conditionalDiscard.frag",
+        "spv.1.6.helperInvocation.frag",
+        "spv.1.6.specConstant.comp",
+        "spv.1.6.samplerBuffer.frag",
+        "spv.1.6.separate.frag",
+    })),
+    FileNameAsCustomTestSuffix
+);
+
+
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(
     Hlsl, HlslIoMap,
     ::testing::ValuesIn(std::vector<IoMapData>{
         { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
@@ -764,6 +813,17 @@ FileNameAsCustomTestSuffix
 );
 
 INSTANTIATE_TEST_SUITE_P(
+    Glsl, CompileVulkanToSpirv14TestNV,
+    ::testing::ValuesIn(std::vector<std::string>({
+    "spv.RayGenShaderMotion.rgen",
+    "spv.IntersectShaderMotion.rint",
+    "spv.AnyHitShaderMotion.rahit",
+    "spv.ClosestHitShaderMotion.rchit",
+    "spv.MissShaderMotion.rmiss",
+})),
+FileNameAsCustomTestSuffix
+);
+INSTANTIATE_TEST_SUITE_P(
     Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
     ::testing::ValuesIn(std::vector<std::string>({
       "spv.texture.sampler.transform.frag",