Externals: Update glslang.

This updates glslang to commit 4fc7a33910fb8e40b970d160e1b38ab3f67fe0f3
which is the current version listed in the known_good.json file for the
version 1.2.131.2 of the Vulkan-ValidationLayers repo.
This commit is contained in:
orbea
2020-03-02 07:42:00 -08:00
parent b3c705fa96
commit 690dee3533
126 changed files with 29560 additions and 13594 deletions

222
Externals/glslang/gtests/Spv.FromFile.cpp vendored Executable file → Normal file
View File

@ -1,5 +1,6 @@
//
// Copyright (C) 2016 Google, Inc.
// Copyright (C) 2019 ARM Limited.
//
// All rights reserved.
//
@ -63,19 +64,18 @@ std::string FileNameAsCustomTestSuffixIoMap(
}
using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileToSpirv14Test = 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>>;
using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
#ifdef AMD_EXTENSIONS
using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
#endif
#ifdef NV_EXTENSIONS
using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
#endif
using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
@ -83,14 +83,39 @@ using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::t
TEST_P(CompileVulkanToSpirvTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv);
}
TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv);
}
// Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
// to successfully generate SPIR-V.
TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan,
glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv, true, "",
"/baseResults/", false, true);
}
TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_3,
Target::Spv);
}
TEST_P(CompileToSpirv14Test, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
Target::Spv);
}
@ -99,7 +124,7 @@ TEST_P(CompileVulkan1_1ToSpirvTest, FromFile)
TEST_P(CompileOpenGLToSpirvTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv);
}
@ -108,7 +133,7 @@ TEST_P(CompileOpenGLToSpirvTest, FromFile)
TEST_P(VulkanSemantics, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv, false);
}
@ -117,7 +142,7 @@ TEST_P(VulkanSemantics, FromFile)
TEST_P(OpenGLSemantics, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv, false);
}
@ -125,7 +150,7 @@ TEST_P(OpenGLSemantics, FromFile)
TEST_P(VulkanAstSemantics, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::AST);
}
@ -159,27 +184,23 @@ TEST_P(GlslIoMap, FromFile)
GetParam().flattenUniforms);
}
#ifdef AMD_EXTENSIONS
// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
// Expected to successfully generate SPIR-V.
TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv);
}
#endif
#ifdef NV_EXTENSIONS
// Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
// Expected to successfully generate SPIR-V.
TEST_P(CompileVulkanToSpirvTestNV, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0,
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
Target::Spv);
}
#endif
TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
{
@ -215,6 +236,12 @@ INSTANTIATE_TEST_CASE_P(
"spv.140.frag",
"spv.150.geom",
"spv.150.vert",
"spv.16bitstorage.frag",
"spv.16bitstorage_Error.frag",
"spv.16bitstorage-int.frag",
"spv.16bitstorage_Error-int.frag",
"spv.16bitstorage-uint.frag",
"spv.16bitstorage_Error-uint.frag",
"spv.300BuiltIns.vert",
"spv.300layout.frag",
"spv.300layout.vert",
@ -231,6 +258,13 @@ INSTANTIATE_TEST_CASE_P(
"spv.450.tesc",
"spv.450.geom",
"spv.450.noRedecl.tesc",
"spv.8bitstorage-int.frag",
"spv.8bitstorage_Error-int.frag",
"spv.8bitstorage-uint.frag",
"spv.8bitstorage_Error-uint.frag",
"spv.8bitstorage-ubo.vert",
"spv.8bitstorage-ssbo.vert",
"spv.8bit-16bit-construction.frag",
"spv.accessChain.frag",
"spv.aggOps.frag",
"spv.always-discard.frag",
@ -241,14 +275,41 @@ INSTANTIATE_TEST_CASE_P(
"spv.bool.vert",
"spv.boolInBlock.frag",
"spv.branch-return.vert",
"spv.bufferhandle1.frag",
"spv.bufferhandle10.frag",
"spv.bufferhandle11.frag",
"spv.bufferhandle12.frag",
"spv.bufferhandle13.frag",
"spv.bufferhandle14.frag",
"spv.bufferhandle15.frag",
"spv.bufferhandle16.frag",
"spv.bufferhandle17_Errors.frag",
"spv.bufferhandle18.frag",
"spv.bufferhandle19_Errors.frag",
"spv.bufferhandle2.frag",
"spv.bufferhandle3.frag",
"spv.bufferhandle4.frag",
"spv.bufferhandle5.frag",
"spv.bufferhandle6.frag",
"spv.bufferhandle7.frag",
"spv.bufferhandle8.frag",
"spv.bufferhandle9.frag",
"spv.bufferhandleUvec2.frag",
"spv.bufferhandle_Error.frag",
"spv.builtInXFB.vert",
"spv.conditionalDemote.frag",
"spv.conditionalDiscard.frag",
"spv.constructComposite.comp",
"spv.constStruct.vert",
"spv.constConstruct.vert",
"spv.controlFlowAttributes.frag",
"spv.conversion.frag",
"spv.coopmat.comp",
"spv.coopmat_Error.comp",
"spv.dataOut.frag",
"spv.dataOutIndirect.frag",
"spv.dataOutIndirect.vert",
"spv.demoteDisabled.frag",
"spv.deepRvalue.frag",
"spv.depthOut.frag",
"spv.discard-dce.frag",
@ -256,16 +317,26 @@ INSTANTIATE_TEST_CASE_P(
"spv.earlyReturnDiscard.frag",
"spv.extPostDepthCoverage.frag",
"spv.extPostDepthCoverage_Error.frag",
"spv.float16convertonlyarith.comp",
"spv.float16convertonlystorage.comp",
"spv.flowControl.frag",
"spv.forLoop.frag",
"spv.forwardFun.frag",
"spv.fragmentDensity.frag",
"spv.fragmentDensity.vert",
"spv.fragmentDensity-es.frag",
"spv.fragmentDensity-neg.frag",
"spv.fsi.frag",
"spv.fsi_Error.frag",
"spv.fullyCovered.frag",
"spv.functionCall.frag",
"spv.functionNestedOpaque.vert",
"spv.functionSemantics.frag",
"spv.functionParameterTypes.frag",
"spv.GeometryShaderPassthrough.geom",
"spv.interpOps.frag",
"spv.int64.frag",
"spv.intcoopmat.comp",
"spv.intOps.vert",
"spv.layoutNested.vert",
"spv.length.frag",
@ -283,6 +354,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.noDeadDecorations.vert",
"spv.nonSquare.vert",
"spv.nonuniform.frag",
"spv.nonuniform2.frag",
"spv.noWorkgroup.comp",
"spv.offsets.frag",
"spv.Operations.frag",
@ -290,11 +362,14 @@ INSTANTIATE_TEST_CASE_P(
"spv.precision.frag",
"spv.precisionNonESSamp.frag",
"spv.prepost.frag",
"spv.privateVariableTypes.frag",
"spv.qualifiers.vert",
"spv.sample.frag",
"spv.sampleId.frag",
"spv.samplePosition.frag",
"spv.sampleMaskOverrideCoverage.frag",
"spv.scalarlayout.frag",
"spv.scalarlayoutfloat16.frag",
"spv.shaderBallot.comp",
"spv.shaderDrawParams.vert",
"spv.shaderGroupVote.comp",
@ -339,11 +414,41 @@ INSTANTIATE_TEST_CASE_P(
"spv.storageBuffer.vert",
"spv.precise.tese",
"spv.precise.tesc",
"spv.volatileAtomic.comp",
"spv.vulkan100.subgroupArithmetic.comp",
"spv.vulkan100.subgroupPartitioned.comp",
"spv.xfb.vert",
"spv.xfb2.vert",
"spv.xfb3.vert",
"spv.samplerlessTextureFunctions.frag",
"spv.smBuiltins.vert",
"spv.smBuiltins.frag",
})),
FileNameAsCustomTestSuffix
);
// Cases with deliberately unreachable code.
// By default the compiler will aggressively eliminate
// unreachable merges and continues.
INSTANTIATE_TEST_CASE_P(
GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.dead-after-continue.vert",
"spv.dead-after-discard.frag",
"spv.dead-after-return.vert",
"spv.dead-after-loop-break.vert",
"spv.dead-after-switch-break.vert",
"spv.dead-complex-continue-after-return.vert",
"spv.dead-complex-merge-after-return.vert",
})),
FileNameAsCustomTestSuffix
);
// clang-format off
INSTANTIATE_TEST_CASE_P(
Glsl, CompileVulkanToDebugSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.pp.line.frag",
})),
FileNameAsCustomTestSuffix
);
@ -352,6 +457,9 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
Glsl, CompileVulkan1_1ToSpirvTest,
::testing::ValuesIn(std::vector<std::string>({
"spv.1.3.8bitstorage-ubo.vert",
"spv.1.3.8bitstorage-ssbo.vert",
"spv.1.3.coopmat.comp",
"spv.deviceGroup.frag",
"spv.drawParams.vert",
"spv.int8.frag",
@ -360,7 +468,10 @@ INSTANTIATE_TEST_CASE_P(
"spv.explicittypes.frag",
"spv.float32.frag",
"spv.float64.frag",
"spv.memoryScopeSemantics.comp",
"spv.memoryScopeSemantics_Error.comp",
"spv.multiView.frag",
"spv.RayGenShader11.rgen",
"spv.subgroup.frag",
"spv.subgroup.geom",
"spv.subgroup.tesc",
@ -369,6 +480,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.subgroupArithmetic.comp",
"spv.subgroupBasic.comp",
"spv.subgroupBallot.comp",
"spv.subgroupBallotNeg.comp",
"spv.subgroupClustered.comp",
"spv.subgroupClusteredNeg.comp",
"spv.subgroupPartitioned.comp",
@ -376,11 +488,46 @@ INSTANTIATE_TEST_CASE_P(
"spv.subgroupShuffleRelative.comp",
"spv.subgroupQuad.comp",
"spv.subgroupVote.comp",
"spv.subgroupExtendedTypesArithmetic.comp",
"spv.subgroupExtendedTypesArithmeticNeg.comp",
"spv.subgroupExtendedTypesBallot.comp",
"spv.subgroupExtendedTypesBallotNeg.comp",
"spv.subgroupExtendedTypesClustered.comp",
"spv.subgroupExtendedTypesClusteredNeg.comp",
"spv.subgroupExtendedTypesPartitioned.comp",
"spv.subgroupExtendedTypesPartitionedNeg.comp",
"spv.subgroupExtendedTypesShuffle.comp",
"spv.subgroupExtendedTypesShuffleNeg.comp",
"spv.subgroupExtendedTypesShuffleRelative.comp",
"spv.subgroupExtendedTypesShuffleRelativeNeg.comp",
"spv.subgroupExtendedTypesQuad.comp",
"spv.subgroupExtendedTypesQuadNeg.comp",
"spv.subgroupExtendedTypesVote.comp",
"spv.subgroupExtendedTypesVoteNeg.comp",
"spv.vulkan110.storageBuffer.vert",
})),
FileNameAsCustomTestSuffix
);
// clang-format off
INSTANTIATE_TEST_CASE_P(
Glsl, CompileToSpirv14Test,
::testing::ValuesIn(std::vector<std::string>({
"spv.1.4.LoopControl.frag",
"spv.1.4.NonWritable.frag",
"spv.1.4.OpEntryPoint.frag",
"spv.1.4.OpSelect.frag",
"spv.1.4.OpCopyLogical.comp",
"spv.1.4.OpCopyLogicalBool.comp",
"spv.1.4.OpCopyLogical.funcall.frag",
"spv.1.4.image.frag",
"spv.1.4.sparseTexture.frag",
"spv.1.4.texture.frag",
"spv.1.4.constructComposite.comp",
})),
FileNameAsCustomTestSuffix
);
// clang-format off
INSTANTIATE_TEST_CASE_P(
Hlsl, HlslIoMap,
@ -423,6 +570,10 @@ INSTANTIATE_TEST_CASE_P(
"spv.rankShift.comp",
"spv.specConst.vert",
"spv.OVR_multiview.vert",
"spv.xfbOffsetOnBlockMembersAssignment.vert",
"spv.xfbOffsetOnStructMembersAssignment.vert",
"spv.xfbOverlapOffsetCheckWithBlockAndMember.vert",
"spv.xfbStrideJustOnce.vert",
})),
FileNameAsCustomTestSuffix
);
@ -433,6 +584,8 @@ INSTANTIATE_TEST_CASE_P(
"vulkan.frag",
"vulkan.vert",
"vulkan.comp",
"samplerlessTextureFunctions.frag",
"spv.specConstArrayCheck.vert",
})),
FileNameAsCustomTestSuffix
);
@ -457,10 +610,10 @@ INSTANTIATE_TEST_CASE_P(
FileNameAsCustomTestSuffix
);
#ifdef AMD_EXTENSIONS
INSTANTIATE_TEST_CASE_P(
Glsl, CompileVulkanToSpirvTestAMD,
::testing::ValuesIn(std::vector<std::string>({
"spv.16bitxfb.vert",
"spv.float16.frag",
"spv.float16Fetch.frag",
"spv.imageLoadStoreLod.frag",
@ -472,9 +625,7 @@ INSTANTIATE_TEST_CASE_P(
})),
FileNameAsCustomTestSuffix
);
#endif
#ifdef NV_EXTENSIONS
INSTANTIATE_TEST_CASE_P(
Glsl, CompileVulkanToSpirvTestNV,
::testing::ValuesIn(std::vector<std::string>({
@ -487,10 +638,41 @@ INSTANTIATE_TEST_CASE_P(
"spv.multiviewPerViewAttributes.vert",
"spv.multiviewPerViewAttributes.tesc",
"spv.atomicInt64.comp",
"spv.shadingRate.frag",
"spv.RayGenShader.rgen",
"spv.RayGenShaderArray.rgen",
"spv.RayGenShader_Errors.rgen",
"spv.RayConstants.rgen",
"spv.IntersectShader.rint",
"spv.IntersectShader_Errors.rint",
"spv.AnyHitShader.rahit",
"spv.AnyHitShader_Errors.rahit",
"spv.ClosestHitShader.rchit",
"spv.ClosestHitShader_Errors.rchit",
"spv.MissShader.rmiss",
"spv.MissShader_Errors.rmiss",
"spv.RayCallable.rcall",
"spv.RayCallable_Errors.rcall",
"spv.fragmentShaderBarycentric.frag",
"spv.fragmentShaderBarycentric2.frag",
"spv.computeShaderDerivatives.comp",
"spv.computeShaderDerivatives2.comp",
"spv.shaderImageFootprint.frag",
"spv.meshShaderBuiltins.mesh",
"spv.meshShaderUserDefined.mesh",
"spv.meshShaderPerViewBuiltins.mesh",
"spv.meshShaderPerViewUserDefined.mesh",
"spv.meshShaderPerView_Errors.mesh",
"spv.meshShaderSharedMem.mesh",
"spv.meshShaderTaskMem.mesh",
"spv.320.meshShaderUserDefined.mesh",
"spv.meshShaderRedeclBuiltins.mesh",
"spv.meshShaderRedeclPerViewBuiltins.mesh",
"spv.meshTaskShader.task",
"spv.perprimitiveNV.frag",
})),
FileNameAsCustomTestSuffix
);
#endif
INSTANTIATE_TEST_CASE_P(
Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,