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 - Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out | 1 - Test/baseResults/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 cce5fa7..db26d59 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 608b4bf..c9a605b 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 4f92426..3f54661 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 c54ba65..d80bfee 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 48094e9..85bfdb2 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 760fb30..f2f85c1 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 733d537..694cff0 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 657d647..3179717 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 02e379c..4adfd4b 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 a36d802..292335e 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 3186db4..7c2de0b 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.7.4