From 59b47ef36f5d4dba8567eb7da4e5d572b6586c9d Mon Sep 17 00:00:00 2001 From: Boris Zanin Date: Mon, 27 May 2019 13:07:02 +0200 Subject: [PATCH] Allow optimization for SPIR-V 1.4 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 | 1 + external/vulkancts/framework/vulkan/vkSpirVProgram.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/external/vulkancts/framework/vulkan/vkPrograms.cpp b/external/vulkancts/framework/vulkan/vkPrograms.cpp index 03d85b2..a77e403 100644 --- a/external/vulkancts/framework/vulkan/vkPrograms.cpp +++ b/external/vulkancts/framework/vulkan/vkPrograms.cpp @@ -109,6 +109,7 @@ void optimizeCompiledBinary (vector& 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"); } diff --git a/external/vulkancts/framework/vulkan/vkSpirVProgram.hpp b/external/vulkancts/framework/vulkan/vkSpirVProgram.hpp index 63c145c..5cc2197 100644 --- a/external/vulkancts/framework/vulkan/vkSpirVProgram.hpp +++ b/external/vulkancts/framework/vulkan/vkSpirVProgram.hpp @@ -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) -- 2.7.4