Allow optimization for SPIR-V 1.4
authorBoris Zanin <boris.zanin@mobica.com>
Mon, 27 May 2019 11:07:02 +0000 (13:07 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 10 Oct 2019 13:27:02 +0000 (09:27 -0400)
This commit updates function optimizeCompiledBinary with
missing optimization reciepe for SPIR-V 1.4.

Also makes supports_VK_KHR_spirv_1_4 as an optional argument of
SpirVAsmBuildOptions constructor, though defaulting it to disable
support of SPIR-V 1.4.

The change affects if run with optimization command line arguments,
i.e. --deqp-optimize-spirv=enable and --deqp-optimization-recipe=!0

Affects:
 * dEQP-VK.spirv_assembly.instruction.spirv1p4.*

Components: Framework

VK-GL-CTS issue: 1636

Change-Id: If0af53ea37521e686ca7d422cab9589cc0460dc5
(cherry picked from commit b0d7da5045419b469a45c766194da1f0e026e824)

external/vulkancts/framework/vulkan/vkPrograms.cpp
external/vulkancts/framework/vulkan/vkSpirVProgram.hpp

index 03d85b2..a77e403 100644 (file)
@@ -109,6 +109,7 @@ void optimizeCompiledBinary (vector<deUint32>& binary, int optimizationRecipe, c
                case SPIRV_VERSION_1_1:
                case SPIRV_VERSION_1_2:
                case SPIRV_VERSION_1_3: targetEnv = SPV_ENV_VULKAN_1_1; break;
+               case SPIRV_VERSION_1_4: targetEnv = SPV_ENV_VULKAN_1_1_SPIRV_1_4;       break;
                default:
                        TCU_THROW(InternalError, "Unexpected SPIR-V version requested");
        }
index 63c145c..5cc2197 100644 (file)
@@ -43,10 +43,10 @@ struct SpirVAsmBuildOptions
        SpirvVersion    targetVersion;
        bool                    supports_VK_KHR_spirv_1_4;
 
-       SpirVAsmBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_)
+       SpirVAsmBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_, bool allowSpirv14 = false)
                : vulkanVersion                         (vulkanVersion_)
                , targetVersion                         (targetVersion_)
-               , supports_VK_KHR_spirv_1_4     (false)
+               , supports_VK_KHR_spirv_1_4     (allowSpirv14)
        {}
 
        SpirVAsmBuildOptions (void)