From b64952eddde03b6520f1092b4f9cddc0914bf80e Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Thu, 9 May 2019 23:50:08 -0600 Subject: [PATCH] SPV 1.4: Move to 1.4 validation, removing all 1.4 validation failures. --- SPIRV/SpvTools.cpp | 17 +++++++++++++++-- Test/baseResults/spv.1.4.LoopControl.frag.out | 1 - Test/baseResults/spv.1.4.NonWritable.frag.out | 1 - Test/baseResults/spv.1.4.OpCopyLogical.comp.out | 1 - .../spv.1.4.OpCopyLogical.funcall.frag.out | 1 - .../spv.1.4.OpCopyLogicalBool.comp.out | 1 - Test/baseResults/spv.1.4.OpEntryPoint.frag.out | 1 - Test/baseResults/spv.1.4.OpSelect.frag.out | 1 - Test/baseResults/spv.1.4.image.frag.out | 1 - Test/baseResults/spv.1.4.sparseTexture.frag.out | 1 - Test/baseResults/spv.1.4.texture.frag.out | 1 - 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/SPIRV/SpvTools.cpp b/SPIRV/SpvTools.cpp index cce5fa71..db26d590 100644 --- a/SPIRV/SpvTools.cpp +++ b/SPIRV/SpvTools.cpp @@ -52,8 +52,21 @@ namespace glslang { spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger) { switch (spvVersion.vulkan) { - case glslang::EShTargetVulkan_1_0: return spv_target_env::SPV_ENV_VULKAN_1_0; - case glslang::EShTargetVulkan_1_1: return spv_target_env::SPV_ENV_VULKAN_1_1; + case glslang::EShTargetVulkan_1_0: + return spv_target_env::SPV_ENV_VULKAN_1_0; + case glslang::EShTargetVulkan_1_1: + switch (spvVersion.spv) { + case EShTargetSpv_1_0: + case EShTargetSpv_1_1: + case EShTargetSpv_1_2: + case EShTargetSpv_1_3: + return spv_target_env::SPV_ENV_VULKAN_1_1; + case EShTargetSpv_1_4: + return spv_target_env::SPV_ENV_VULKAN_1_1_SPIRV_1_4; + default: + logger->missingFunctionality("Target version for SPIRV-Tools validator"); + return spv_target_env::SPV_ENV_VULKAN_1_1; + } default: break; } diff --git a/Test/baseResults/spv.1.4.LoopControl.frag.out b/Test/baseResults/spv.1.4.LoopControl.frag.out index 608b4bfc..c9a605b9 100644 --- a/Test/baseResults/spv.1.4.LoopControl.frag.out +++ b/Test/baseResults/spv.1.4.LoopControl.frag.out @@ -2,7 +2,6 @@ spv.1.4.LoopControl.frag WARNING: 0:15: 'min_iterations' : expected a single integer argument WARNING: 0:15: 'max_iterations' : expected a single integer argument -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 54 diff --git a/Test/baseResults/spv.1.4.NonWritable.frag.out b/Test/baseResults/spv.1.4.NonWritable.frag.out index 4f92426d..3f54661d 100755 --- a/Test/baseResults/spv.1.4.NonWritable.frag.out +++ b/Test/baseResults/spv.1.4.NonWritable.frag.out @@ -1,5 +1,4 @@ spv.1.4.NonWritable.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 38 diff --git a/Test/baseResults/spv.1.4.OpCopyLogical.comp.out b/Test/baseResults/spv.1.4.OpCopyLogical.comp.out index c54ba650..d80bfee7 100644 --- a/Test/baseResults/spv.1.4.OpCopyLogical.comp.out +++ b/Test/baseResults/spv.1.4.OpCopyLogical.comp.out @@ -1,5 +1,4 @@ spv.1.4.OpCopyLogical.comp -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 65 diff --git a/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out b/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out index 48094e91..85bfdb26 100644 --- a/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out +++ b/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out @@ -1,5 +1,4 @@ spv.1.4.OpCopyLogical.funcall.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 60 diff --git a/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out b/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out index 760fb301..f2f85c10 100644 --- a/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out +++ b/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out @@ -1,5 +1,4 @@ spv.1.4.OpCopyLogicalBool.comp -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 135 diff --git a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out index 733d5377..694cff04 100644 --- a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out +++ b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out @@ -1,5 +1,4 @@ spv.1.4.OpEntryPoint.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 64 diff --git a/Test/baseResults/spv.1.4.OpSelect.frag.out b/Test/baseResults/spv.1.4.OpSelect.frag.out index 657d6472..31797170 100755 --- a/Test/baseResults/spv.1.4.OpSelect.frag.out +++ b/Test/baseResults/spv.1.4.OpSelect.frag.out @@ -1,5 +1,4 @@ spv.1.4.OpSelect.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 98 diff --git a/Test/baseResults/spv.1.4.image.frag.out b/Test/baseResults/spv.1.4.image.frag.out index 02e379c3..4adfd4bd 100755 --- a/Test/baseResults/spv.1.4.image.frag.out +++ b/Test/baseResults/spv.1.4.image.frag.out @@ -1,5 +1,4 @@ spv.1.4.image.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 104 diff --git a/Test/baseResults/spv.1.4.sparseTexture.frag.out b/Test/baseResults/spv.1.4.sparseTexture.frag.out index a36d8021..292335ed 100755 --- a/Test/baseResults/spv.1.4.sparseTexture.frag.out +++ b/Test/baseResults/spv.1.4.sparseTexture.frag.out @@ -1,5 +1,4 @@ spv.1.4.sparseTexture.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 213 diff --git a/Test/baseResults/spv.1.4.texture.frag.out b/Test/baseResults/spv.1.4.texture.frag.out index 3186db43..7c2de0bb 100755 --- a/Test/baseResults/spv.1.4.texture.frag.out +++ b/Test/baseResults/spv.1.4.texture.frag.out @@ -1,5 +1,4 @@ spv.1.4.texture.frag -Validation failed // Module Version 10400 // Generated by (magic number): 80007 // Id's are bound by 79 -- 2.34.1