using HlslCompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
+using HlslSpv1_6CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
+using HlslNonSemanticShaderDebugInfoTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected
// to successfully generate both AST and SPIR-V.
Target::BothASTAndSpv, true, GetParam().entryPoint);
}
+TEST_P(HlslSpv1_6CompileTest, FromFile)
+{
+ loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
+ Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_3, glslang::EShTargetSpv_1_6,
+ Target::BothASTAndSpv, true, GetParam().entryPoint);
+}
+
TEST_P(HlslCompileAndFlattenTest, FromFile)
{
loadFileCompileFlattenUniformsAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
"/baseResults/", true, true);
}
+TEST_P(HlslNonSemanticShaderDebugInfoTest, FromFile)
+{
+ loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
+ Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
+ Target::Spv, true, GetParam().entryPoint, "/baseResults/", false, false, true);
+}
+
// clang-format off
INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslCompileTest,
{"hlsl.groupid.comp", "main"},
{"hlsl.identifier.sample.frag", "main"},
{"hlsl.if.frag", "PixelShaderFunction"},
+ {"hlsl.imageload-subvec4.comp", "main"},
{"hlsl.imagefetch-subvec4.comp", "main"},
{"hlsl.implicitBool.frag", "main"},
{"hlsl.inf.vert", "main"},
{"hlsl.structbuffer.fn2.comp", "main"},
{"hlsl.structbuffer.rw.frag", "main"},
{"hlsl.structbuffer.rwbyte.frag", "main"},
+ {"hlsl.structbuffer.rwbyte2.comp", "main"},
{"hlsl.structin.vert", "main"},
{"hlsl.structIoFourWay.frag", "main"},
{"hlsl.structStructName.frag", "main"},
{"hlsl.typedef.frag", "PixelShaderFunction"},
{"hlsl.whileLoop.frag", "PixelShaderFunction"},
{"hlsl.void.frag", "PixelShaderFunction"},
- {"hlsl.type.type.conversion.all.frag", "main"}
+ {"hlsl.type.type.conversion.all.frag", "main"},
+ {"hlsl.instance.geom", "GeometryShader"}
}),
FileNameAsCustomTestSuffix
);
// clang-format off
INSTANTIATE_TEST_SUITE_P(
+ ToSpirv, HlslSpv1_6CompileTest,
+ ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
+ {"hlsl.spv.1.6.discard.frag", "PixelShaderFunction"}
+ }),
+ FileNameAsCustomTestSuffix
+);
+// clang-format on
+
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslCompileAndFlattenTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.array.flatten.frag", "main"},
}),
FileNameAsCustomTestSuffix
);
+// clang-format on
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(
+ ToSpirv, HlslNonSemanticShaderDebugInfoTest,
+ ::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
+ {"spv.debuginfo.hlsl.vert", "main"},
+ {"spv.debuginfo.hlsl.frag", "main"},
+ {"spv.debuginfo.hlsl.comp", "main"},
+ {"spv.debuginfo.hlsl.geom", "main"},
+ {"spv.debuginfo.hlsl.tesc", "main"},
+ {"spv.debuginfo.hlsl.tese", "main"},
+ }),
+ FileNameAsCustomTestSuffix
+);
// clang-format on
} // anonymous namespace