- C:/Python27/python.exe update_glslang_sources.py
- set PATH=C:\ninja;C:\Python36;%PATH%
- git clone https://github.com/google/googletest.git External/googletest
- - cd External/googletest
- - git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
- - cd ../..
build:
parallel: true # enable MSBuild parallel builds
### Dependencies
* A C++11 compiler.
- (For MSVS: 2015 is recommended, 2013 is fully supported/tested, and 2010 support is attempted, but not tested.)
+ (For MSVS: use 2015 or later.)
* [CMake][cmake]: for generating compilation targets.
* make: _Linux_, ninja is an alternative, if configured.
* [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.)
git clone https://github.com/google/googletest.git External/googletest
```
-If you want to use googletest with Visual Studio 2013, you also need to check out an older version:
-
-```bash
-# to use googletest with Visual Studio 2013
-cd External/googletest
-git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
-cd ../..
-```
-
If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, or wish to run the
integrated test suite, install spirv-tools with this:
http_archive(
name = "com_google_googletest",
- sha256 = "ef9e2e12e7bf115ee48b427ae171fc869eeaf1b532c0fcfd982f6a353d2471b4",
- strip_prefix = "googletest-37ae1fc5e6be26f367d76c078beabd7024fed53a",
- urls = ["https://github.com/google/googletest/archive/37ae1fc5e6be26f367d76c078beabd7024fed53a.zip"], # 2018-07-16
+ sha256 = "94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91",
+ strip_prefix = "googletest-release-1.10.0",
+ urls = ["https://github.com/google/googletest/archive/release-1.10.0.zip"], # 3-Oct-2019
)
http_archive(
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileToAstTest,
::testing::ValuesIn(std::vector<std::string>({
"sample.frag",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileToAstTestNV,
::testing::ValuesIn(std::vector<std::string>({
"nvShaderNoperspectiveInterpolation.frag",
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, ConfigTest,
::testing::ValuesIn(std::vector<TestCaseSpec>({
{"specExamples.vert", "baseResults/test.conf", "specExamplesConf.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)},
EXPECT_THAT(Decode<double>(GetParam().second), Eq(GetParam().first));
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float32Tests, HexFloatTest,
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
{0.f, "0x0p+0"},
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float32NanTests, HexFloatTest,
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
// Various NAN and INF cases
{uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float64Tests, HexDoubleTest,
::testing::ValuesIn(
std::vector<std::pair<FloatProxy<double>, std::string>>({
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float64NanTests, HexDoubleTest,
::testing::ValuesIn(std::vector<
std::pair<FloatProxy<double>, std::string>>({
EXPECT_THAT(Decode<double>(GetParam().first), Eq(GetParam().second));
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float32DecodeTests, DecodeHexFloatTest,
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
{"0x0p+000", 0.f},
{"0x0.4p+0", 0.25f},
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float32DecodeInfTests, DecodeHexFloatTest,
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
// inf cases
{"-0x32p+127", uint32_t(0xFF800000)}, // -inf
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float64DecodeTests, DecodeHexDoubleTest,
::testing::ValuesIn(
std::vector<std::pair<std::string, FloatProxy<double>>>({
{"0x0.4p+0", 0.25},
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float64DecodeInfTests, DecodeHexDoubleTest,
::testing::ValuesIn(
std::vector<std::pair<std::string, FloatProxy<double>>>({
Eq(GetParam().second));
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float32Tests, FloatProxyFloatTest,
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
// Zero
{-std::numeric_limits<float>::infinity(), "-0x1p+128"},
})));
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float64Tests, FloatProxyDoubleTest,
::testing::ValuesIn(
std::vector<std::pair<FloatProxy<double>, std::string>>({
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
+INSTANTIATE_TEST_SUITE_P(F32ToF16, HexFloatRoundTest,
::testing::ValuesIn(std::vector<RoundSignificandCase>(
{
{float_fractions({0}), std::make_pair(half_bits_set({}), false), spvutils::kRoundToZero},
}
}
-INSTANTIATE_TEST_CASE_P(F16toF32, HexFloatRoundUpSignificandTest,
+INSTANTIATE_TEST_SUITE_P(F16toF32, HexFloatRoundUpSignificandTest,
// 0xFC00 of the source 16-bit hex value cover the sign and the exponent.
// They are ignored for this test.
::testing::ValuesIn(std::vector<UpCastSignificandCase>(
const uint16_t positive_infinity = 0x7C00;
const uint16_t negative_infinity = 0xFC00;
-INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatFP32To16Tests,
+INSTANTIATE_TEST_SUITE_P(F32ToF16, HexFloatFP32To16Tests,
::testing::ValuesIn(std::vector<DownCastTest>(
{
// Exactly representable as half.
}
}
-INSTANTIATE_TEST_CASE_P(F16ToF32, HexFloatFP16To32Tests,
+INSTANTIATE_TEST_SUITE_P(F16ToF32, HexFloatFP16To32Tests,
::testing::ValuesIn(std::vector<UpCastCase>(
{
{0x0000, 0.f},
return FloatParseCase<T>{literal, negate_value, true, proxy_expected_value};
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
FloatParse, ParseNormalFloatTest,
::testing::ValuesIn(std::vector<FloatParseCase<float>>{
// Failing cases due to trivially incorrect syntax.
}
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float16Parse, ParseNormalFloat16Test,
::testing::ValuesIn(std::vector<FloatParseCase<Float16>>{
// Failing cases due to trivially incorrect syntax.
}
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
FloatOverflow, FloatProxyParseOverflowFloatTest,
::testing::ValuesIn(std::vector<OverflowParseCase<float>>({
{"0", true, 0.0f},
}
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
DoubleOverflow, FloatProxyParseOverflowDoubleTest,
::testing::ValuesIn(std::vector<OverflowParseCase<double>>({
{"0", true, 0.0},
}
}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Float16Overflow, FloatProxyParseOverflowFloat16Test,
::testing::ValuesIn(std::vector<OverflowParseCase<uint16_t>>({
{"0", true, uint16_t{0}},
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslCompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.amend.frag", "f1"},
// clang-format on
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslVulkan1_1CompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.wavebroadcast.comp", "CSMain"},
// clang-format on
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslCompileAndFlattenTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.array.flatten.frag", "main"},
#if ENABLE_OPT
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslLegalizeTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.aliasOpaque.frag", "main"},
#endif
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslDebugTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.pp.line2.frag", "MainPs"}
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslDX9CompatibleTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.sample.dx9.frag", "main"},
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslLegalDebugTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.pp.line4.frag", "MainPs"}
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, LinkTestVulkan,
::testing::ValuesIn(std::vector<std::vector<std::string>>({
{"link1.vk.frag", "link2.vk.frag"},
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, LinkTest,
::testing::ValuesIn(std::vector<std::vector<std::string>>({
{"mains1.frag", "mains2.frag", "noMain1.geom", "noMain2.geom"},
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, PreprocessingTest,
::testing::ValuesIn(std::vector<std::string>({
"preprocessor.bad_arg.vert",
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
ToSpirv, RemapTest,
::testing::ValuesIn(std::vector<RemapTestArgs>{
// GLSL remapper tests
}
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileVulkanToSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
// Test looping constructs.
// Cases with deliberately unreachable code.
// By default the compiler will aggressively eliminate
// unreachable merges and continues.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.dead-after-continue.vert",
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileVulkanToDebugSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.pp.line.frag",
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileVulkan1_1ToSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.1.3.8bitstorage-ubo.vert",
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileToSpirv14Test,
::testing::ValuesIn(std::vector<std::string>({
"spv.1.4.LoopControl.frag",
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Hlsl, HlslIoMap,
::testing::ValuesIn(std::vector<IoMapData>{
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Hlsl, GlslIoMap,
::testing::ValuesIn(std::vector<IoMapData>{
{ "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
);
// clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileOpenGLToSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.460.frag",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, VulkanSemantics,
::testing::ValuesIn(std::vector<std::string>({
"vulkan.frag",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, OpenGLSemantics,
::testing::ValuesIn(std::vector<std::string>({
"glspv.esversion.vert",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, VulkanAstSemantics,
::testing::ValuesIn(std::vector<std::string>({
"vulkan.ast.vert",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileVulkanToSpirvTestAMD,
::testing::ValuesIn(std::vector<std::string>({
"spv.16bitxfb.vert",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileVulkanToSpirvTestNV,
::testing::ValuesIn(std::vector<std::string>({
"spv.sampleMaskOverrideCoverage.frag",
FileNameAsCustomTestSuffix
);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.texture.sampler.transform.frag",