compiler/clc: Preserve OCL kernel arg type metadata on LLVM13

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13177>
This commit is contained in:
Jesse Natalie 2021-10-04 09:32:02 -07:00 committed by Marge Bot
parent 3a752256f5
commit 82c69c9a9d
1 changed files with 5 additions and 0 deletions

View File

@ -914,6 +914,11 @@ llvm_mod_to_spirv(std::unique_ptr<::llvm::Module> mod,
}
SPIRV::TranslatorOpts spirv_opts = SPIRV::TranslatorOpts(version, ext_map);
#if LLVM_VERSION_MAJOR >= 13
/* This was the default in 12.0 and older, but currently we'll fail to parse without this */
spirv_opts.setPreserveOCLKernelArgTypeMetadataThroughString(true);
#endif
std::ostringstream spv_stream;
if (!::llvm::writeSpirv(mod.get(), spirv_opts, spv_stream, log)) {
clc_error(logger, "%sTranslation from LLVM IR to SPIR-V failed.\n",