From 1385c024d26249606dcf9fd56353a9d68803eb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 25 Sep 2020 19:56:23 -0700 Subject: [PATCH] Updated spirv-tools. --- 3rdparty/spirv-tools/CHANGES | 53 ++++++++++++++++++- .../include/generated/build-version.inc | 2 +- 3rdparty/spirv-tools/source/binary.cpp | 8 +++ 3rdparty/spirv-tools/source/cfa.h | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/3rdparty/spirv-tools/CHANGES b/3rdparty/spirv-tools/CHANGES index 4ee7ef909..3c81249df 100644 --- a/3rdparty/spirv-tools/CHANGES +++ b/3rdparty/spirv-tools/CHANGES @@ -1,7 +1,56 @@ Revision history for SPIRV-Tools -v2020.5 2020-07-22 - - Start SPIRV-Tools v2020.5 +v2020.6 2020-09-24 + - Start SPIRV-Tools v2020.6 + +v2020.5 2020-09-22 + - General + - Enable building with BUILD_SHARED_LIBS=1 (#3490) + - Avoid using /MP4 for clang on windows. (#3662) + - Fix compiler error on macOS with XCode12. (#3836) + - Optimizer + - Preserve OpenCL.DebugInfo.100 through private-to-local pass (#3571) + - Preserve debug info in scalar replacement pass (#3461) + - Debug info preservation in loop-unroll pass (#3548) + - Preserve debug info in dead-insert-elim pass (#3652) + - Improve non-semantic instruction handling in the optimizer (#3693) + - Let ADCE pass check DebugScope (#3703) + - Add undef for inlined void function (#3720) + - Fix SSA-rewrite to remove DebugDeclare for variables without loads (#3719) + - Handle DebugScope in compact-ids pass (#3724) + - Add buffer oob check to bindless instrumentation (#3800) + - Validator + - Update OpenCL capabilities validation (#3149) + - Validator support for non-semantic clspv reflection (#3618) + - OpenCL.DebugInfo.100 DebugTypeArray with variable size (#3549) + - Only validation locations for appropriate execution models (#3656) + - Validate more OpenCL.DebugInfo.100 instructions (#3684) + - Allow DebugTypeTemplate for Type operand (#3702) + - spirv-val: Add Vulkan VUID labels to BuiltIn (#3756) + - Allow SPV_KHR_8bit_storage extension. (#3780) + - Validate SPIRV Version number when parsing binary header (#3834) + - Reduce + - Support reducing a specific function (#3774) + - Fuzz + - adds TransformationReplaceCopyObjectWithStoreLoad (#3567) + - adds TransformationReplaceCopyMemoryWithLoadStore (#3575) + - adds TransformationReplaceLoadStoreWithCopyMemory (#3586) + - Implement the OpOuterProduct linear algebra case (#3617) + - Pass to replace int operands with ints of opposite signedness (#3612) + - TransformationMoveInstructionDown (#3477) + - Add TransformationMakeVectorOperationDynamic (#3597) + - TransformationReplaceAddSubMulWithCarryingExtended (#3598) + - FuzzerPassPropagateInstructionsUp (#3478) + - add FuzzerPassAddCompositeInserts (#3606) + - Add inline function transformation (#3517) + - Transformation to replace the use of an irrelevant id (#3697) + - Add SPIRV_FUZZ_PROTOC_COMMAND (#3789) + - Add TransformationDuplicateRegionWithSelection (#3773) + - Transformation to flatten conditional branch (#3667) + - Handle OpPhis in TransformationInlineFunction (#3833) + - Create synonym of int constant using a loop (#3790) + - Support dead blocks in TransformationAddSynonym (#3832) + - Linker v2020.4 2020-07-22 - General diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index 42d06e005..4190dea5d 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2020.5", "SPIRV-Tools v2020.5 b2259d7c11768aa4bcafa242d63802e9ca427764" +"v2020.6", "SPIRV-Tools v2020.6 c0bce01cc910732f92772dde968d6611431e9d09" diff --git a/3rdparty/spirv-tools/source/binary.cpp b/3rdparty/spirv-tools/source/binary.cpp index f16bf5227..75a997d30 100644 --- a/3rdparty/spirv-tools/source/binary.cpp +++ b/3rdparty/spirv-tools/source/binary.cpp @@ -45,6 +45,14 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, // TODO: Validation checking? pHeader->magic = spvFixWord(binary->code[SPV_INDEX_MAGIC_NUMBER], endian); pHeader->version = spvFixWord(binary->code[SPV_INDEX_VERSION_NUMBER], endian); + // Per 2.3.1 version's high and low bytes are 0 + if ((pHeader->version & 0x000000ff) || pHeader->version & 0xff000000) + return SPV_ERROR_INVALID_BINARY; + // Minimum version was 1.0 and max version is defined by SPV_VERSION. + if (pHeader->version < SPV_SPIRV_VERSION_WORD(1, 0) || + pHeader->version > SPV_VERSION) + return SPV_ERROR_INVALID_BINARY; + pHeader->generator = spvFixWord(binary->code[SPV_INDEX_GENERATOR_NUMBER], endian); pHeader->bound = spvFixWord(binary->code[SPV_INDEX_BOUND], endian); diff --git a/3rdparty/spirv-tools/source/cfa.h b/3rdparty/spirv-tools/source/cfa.h index 0d09014c9..17a4ea5b4 100644 --- a/3rdparty/spirv-tools/source/cfa.h +++ b/3rdparty/spirv-tools/source/cfa.h @@ -127,7 +127,7 @@ class CFA { template bool CFA::FindInWorkList(const std::vector& work_list, uint32_t id) { - for (const auto& b : work_list) { + for (auto& b : work_list) { if (b.block->id() == id) return true; } return false;