aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2021-10-29 10:32:41 -0400
committerGitHub <noreply@github.com>2021-10-29 10:32:41 -0400
commitbd5bf754b1b09cb1a790110640f1c9e5d56fe9f7 (patch)
treef4762b45f06d5093b4517847031e36619d361a5a
parent791f5b463aa46662a5ad81db72f78a69211635f1 (diff)
downloadspirv-tools-bd5bf754b1b09cb1a790110640f1c9e5d56fe9f7.tar.gz
Fix Linker generator ID (#4601)
The generator ID is located in the upper 16 bits. The lower bits are reserved for a version number. Co-authored-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-rw-r--r--source/link/linker.cpp3
-rw-r--r--source/spirv_constant.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/source/link/linker.cpp b/source/link/linker.cpp
index 8da4a98d..c5ca5625 100644
--- a/source/link/linker.cpp
+++ b/source/link/linker.cpp
@@ -34,6 +34,7 @@
#include "source/opt/pass_manager.h"
#include "source/opt/remove_duplicates_pass.h"
#include "source/opt/type_manager.h"
+#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/util/make_unique.h"
#include "spirv-tools/libspirv.hpp"
@@ -207,7 +208,7 @@ spv_result_t GenerateHeader(const MessageConsumer& consumer,
header->magic_number = SpvMagicNumber;
header->version = version;
- header->generator = 17u;
+ header->generator = SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_LINKER, 0);
header->bound = max_id_bound;
header->reserved = 0u;
diff --git a/source/spirv_constant.h b/source/spirv_constant.h
index 39771ccb..8636806c 100644
--- a/source/spirv_constant.h
+++ b/source/spirv_constant.h
@@ -84,6 +84,7 @@ typedef enum spv_generator_t {
SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR = 6,
SPV_GENERATOR_KHRONOS_ASSEMBLER = 7,
SPV_GENERATOR_KHRONOS_GLSLANG = 8,
+ SPV_GENERATOR_KHRONOS_LINKER = 17,
SPV_GENERATOR_NUM_ENTRIES,
SPV_FORCE_16_BIT_ENUM(spv_generator_t)
} spv_generator_t;