diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index 7e5d2cd3..7744abf0 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -162,8 +162,11 @@ typedef enum { LAST_ELEMENT_MARKER(EShTargetCount), } EShTargetLanguage; +// TODO(greg-lunarg): Fix non-determinism problem with Universal +// https://github.com/KhronosGroup/glslang/issues/2858 + typedef enum { - EShTargetUniversal = 0, // Universal + EShTargetUniversal = 0, // Universal - Do not use, see comment above EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0 EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1 EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2 diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index 73842a8a..6c959105 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -59,7 +59,7 @@ std::string FileNameAsCustomTestSuffix( using HlslCompileTest = GlslangTest<::testing::TestWithParam>; using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam>; -using HlslSpv1_6CompileTest = GlslangTest<::testing::TestWithParam>; +//using HlslSpv1_6CompileTest = GlslangTest<::testing::TestWithParam>; using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam>; using HlslLegalizeTest = GlslangTest<::testing::TestWithParam>; using HlslDebugTest = GlslangTest<::testing::TestWithParam>; @@ -82,12 +82,14 @@ TEST_P(HlslVulkan1_1CompileTest, FromFile) Target::BothASTAndSpv, true, GetParam().entryPoint); } -TEST_P(HlslSpv1_6CompileTest, FromFile) -{ - loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, - Source::HLSL, Semantics::Vulkan, glslang::EShTargetUniversal, glslang::EShTargetSpv_1_6, - Target::BothASTAndSpv, true, GetParam().entryPoint); -} +// TODO(greg-lunarg): Re-enable tests when Vulkan1.3 ClientTarget is available + +//TEST_P(HlslSpv1_6CompileTest, FromFile) +//{ +// loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, +// Source::HLSL, Semantics::Vulkan, glslang::EShTargetUniversal, glslang::EShTargetSpv_1_6, +// Target::BothASTAndSpv, true, GetParam().entryPoint); +//} TEST_P(HlslCompileAndFlattenTest, FromFile) { @@ -459,13 +461,13 @@ INSTANTIATE_TEST_SUITE_P( // clang-format on // clang-format off -INSTANTIATE_TEST_SUITE_P( - ToSpirv, HlslSpv1_6CompileTest, - ::testing::ValuesIn(std::vector{ - {"hlsl.spv.1.6.discard.frag", "PixelShaderFunction"} - }), - FileNameAsCustomTestSuffix -); +//INSTANTIATE_TEST_SUITE_P( +// ToSpirv, HlslSpv1_6CompileTest, +// ::testing::ValuesIn(std::vector{ +// {"hlsl.spv.1.6.discard.frag", "PixelShaderFunction"} +// }), +// FileNameAsCustomTestSuffix +//); // clang-format on // clang-format off diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index 85f5d03c..ca13b88d 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -69,7 +69,7 @@ using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithPara using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam>; using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam>; using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam>; -using CompileToSpirv16Test = GlslangTest<::testing::TestWithParam>; +//using CompileToSpirv16Test = GlslangTest<::testing::TestWithParam>; using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam>; using VulkanSemantics = GlslangTest<::testing::TestWithParam>; using OpenGLSemantics = GlslangTest<::testing::TestWithParam>; @@ -123,12 +123,14 @@ TEST_P(CompileToSpirv14Test, FromFile) Target::Spv); } -TEST_P(CompileToSpirv16Test, FromFile) -{ - loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, glslang::EShTargetUniversal, glslang::EShTargetSpv_1_6, - Target::Spv); -} +// TODO(greg-lunarg): Re-enable tests when Vulkan1.3 ClientTarget is available + +//TEST_P(CompileToSpirv16Test, FromFile) +//{ +// loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), +// Source::GLSL, Semantics::Vulkan, glslang::EShTargetUniversal, glslang::EShTargetSpv_1_6, +// Target::Spv); +//} // Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully // generate SPIR-V. @@ -630,15 +632,15 @@ INSTANTIATE_TEST_SUITE_P( ); // clang-format off -INSTANTIATE_TEST_SUITE_P( - Glsl, CompileToSpirv16Test, - ::testing::ValuesIn(std::vector({ - "spv.1.6.conditionalDiscard.frag", - "spv.1.6.helperInvocation.frag", - "spv.1.6.specConstant.comp", - })), - FileNameAsCustomTestSuffix -); +//INSTANTIATE_TEST_SUITE_P( +// Glsl, CompileToSpirv16Test, +// ::testing::ValuesIn(std::vector({ +// "spv.1.6.conditionalDiscard.frag", +// "spv.1.6.helperInvocation.frag", +// "spv.1.6.specConstant.comp", +// })), +// FileNameAsCustomTestSuffix +//); // clang-format off